Blender V2.61 - r43446

subd_edge.h

Go to the documentation of this file.
00001 /*
00002  * Original code in the public domain -- castanyo@yahoo.es
00003  * 
00004  * Modifications copyright (c) 2011, Blender Foundation.
00005  * All rights reserved.
00006  * 
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions are
00009  * met:
00010  * * Redistributions of source code must retain the above copyright
00011  *   notice, this list of conditions and the following disclaimer.
00012  * * Redistributions in binary form must reproduce the above copyright
00013  *   notice, this list of conditions and the following disclaimer in the
00014  *   documentation and/or other materials provided with the distribution.
00015  * 
00016  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00017  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00018  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00019  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00020  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00021  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00022  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00026  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00029 #ifndef __SUBD_EDGE_H__
00030 #define __SUBD_EDGE_H__
00031 
00032 #include "subd_mesh.h"
00033 
00034 CCL_NAMESPACE_BEGIN
00035 
00036 /* Subd Half Edge */
00037 
00038 class SubdEdge
00039 {
00040 public:
00041     int id;
00042     
00043     SubdEdge *next;
00044     SubdEdge *prev;
00045     SubdEdge *pair;
00046     SubdVert *vert;
00047     SubdFace *face;
00048 
00049     SubdEdge(int id_)
00050     {
00051         id = id_;
00052         next = NULL;
00053         prev = NULL;
00054         pair = NULL;
00055         vert = NULL;
00056         face = NULL;
00057     }
00058     
00059     /* vertex queries */
00060     SubdVert *from() { return vert; }
00061     SubdVert *to() { return next->vert; }
00062 
00063     /* face queries */
00064     bool is_boundary() { return !(face && pair->face); }
00065 };
00066 
00067 CCL_NAMESPACE_END
00068 
00069 #endif /* __SUBD_EDGE_H__ */
00070