Blender  V2.93
WXEdgeBuilder.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
23 #include "WXEdgeBuilder.h"
24 #include "WXEdge.h"
25 
26 namespace Freestyle {
27 
28 void WXEdgeBuilder::visitIndexedFaceSet(IndexedFaceSet &ifs)
29 {
31  return;
32  }
33  WXShape *shape = new WXShape;
34  if (!buildWShape(*shape, ifs)) {
35  delete shape;
36  return;
37  }
38  shape->setId(ifs.getId().getFirst());
39  shape->setName(ifs.getName());
40  shape->setLibraryPath(ifs.getLibraryPath());
41  // ifs.setId(shape->GetId());
42 }
43 
44 void WXEdgeBuilder::buildWVertices(WShape &shape, const float *vertices, unsigned vsize)
45 {
46  WXVertex *vertex;
47  for (unsigned int i = 0; i < vsize; i += 3) {
48  vertex = new WXVertex(Vec3f(vertices[i], vertices[i + 1], vertices[i + 2]));
49  vertex->setId(i / 3);
50  shape.AddVertex(vertex);
51  }
52 }
53 
54 } /* namespace Freestyle */
Class inherited from WingedEdgeBuilder and designed to build a WX (WingedEdge + extended info (silhou...
Classes to define an Extended Winged Edge data structure.
void AddVertex(WVertex *iVertex)
Definition: WEdge.h:1247
void setId(int id)
Definition: WEdge.h:125
virtual void buildWVertices(WShape &shape, const float *vertices, unsigned vsize)
virtual bool buildWShape(WShape &shape, IndexedFaceSet &ifs)
struct Vec3f Vec3f
inherits from class Rep
Definition: AppCanvas.cpp:32