OpenLexocad  27.1
IvWriter.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Inventor/SbVec3f.h>
4 
5 #include <string>
6 
7 class SoMaterial;
8 
9 namespace App
10 {
11 class Element;
12 }
13 
14 namespace OpenLxApp
15 {
16 class myFace
17 {
18 public:
19  std::vector<SbVec3f> vertices;
20  std::vector<SbVec3f> verticesNormals;
21  std::vector<long> coordinateIndices;
22  bool useNormals;
23 };
24 
25 class myEdge
26 {
27 public:
28  std::vector<SbVec3f> vertices;
29  std::vector<long> coordinateIndices;
30 };
31 
32 
33 
34 class IvWriter
35 {
36 public:
37  IvWriter::IvWriter(const std::vector<App::Element*>& elems);
38 
40  bool saveIV(const std::string& filename);
41 
42 private:
43  const std::vector<App::Element*>& _elems;
44 
45  bool _createFaces(pConstShape shape, std::vector<myFace>& myFaces, std::map<int, int>& face_2_material_index, int colorIndex);
46  bool _createEdges(pConstShape shape,
47  std::vector<myEdge>& myEdges,
48  std::map<int, int>& edge_2_material_index,
49  int colorIndex,
50  double abscissa = 0);
51 
52  void _createMaterial(App::Element* e, SoMaterial* oiv_mat, int& materialIndex, bool& useMaterial);
53 };
54 
55 
56 } // namespace OpenLxApp
Definition: IvWriter.h:25
std::vector< SbVec3f > vertices
Definition: IvWriter.h:19
std::vector< SbVec3f > vertices
Definition: IvWriter.h:28
Definition: IvWriter.h:16
bool useNormals
Definition: IvWriter.h:22
Definition: ActiveScript.h:7
std::vector< long > coordinateIndices
Definition: IvWriter.h:29
Core::PropertyText filename
Definition: CoreDocument.h:176
Definition: IvWriter.h:34
std::vector< long > coordinateIndices
Definition: IvWriter.h:21
IvWriter::IvWriter(const std::vector< App::Element * > &elems)
std::vector< SbVec3f > verticesNormals
Definition: IvWriter.h:20
std::shared_ptr< Topo::Shape const > pConstShape
Definition: Variant.h:77
bool saveIV(const std::string &filename)
Saves the document to 'filename'.