OpenLexocad  27.1
IndexedMesh.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #include <Base/Writer.h>
5 #include <Geom/Dir.h>
6 #include <Geom/Pnt.h>
7 
8 namespace Geom
9 {
10 class LX_GEOM_EXPORT IndexedMesh
11 {
12 public:
13  IndexedMesh(void);
14  IndexedMesh(const IndexedMesh& other);
15  IndexedMesh(const std::vector<int>& model, const std::vector<Geom::Pnt>& points);
16  virtual ~IndexedMesh(void);
17 
18  // SoIndexedFaceSet-Format
19  std::vector<Geom::Pnt> face_vertices;
20  std::vector<long> face_coordinateIndices;
21  // normals are obligatory, vbos!
22  std::vector<Geom::Dir> face_per_vertex_normals;
23  // color: 0xrrggbbaa
24  std::vector<unsigned int> face_color_per_vertex;
25 
26  // SoIndexedLineSet-Format
27  std::vector<Geom::Pnt> wire_vertices;
28  std::vector<long> wire_coordinateIndices;
29  std::vector<unsigned int> wire_color_per_vertex;
30 
31  IndexedMesh& operator=(const IndexedMesh&);
32  bool operator==(const IndexedMesh& c) const;
33 
34  virtual void transform(const Geom::Trsf& t);
35  void createEdges(const std::vector<int>& model, const std::vector<Geom::Pnt>& points);
36 
37  bool restore(const std::string& s);
38 
39  static bool setBinaryReadMode(bool on);
40  static bool setBinaryWriteMode(bool on);
41 };
42 
43 
44 
45  LX_GEOM_EXPORT std::istream& operator>>(std::istream& is, Geom::IndexedMesh& op);
46  LX_GEOM_EXPORT std::ostream& operator<<(std::ostream& os, Geom::IndexedMesh& op);
47 
48 
49 
50 } // namespace Geom
51 
52 
54 
55 typedef std::shared_ptr<Geom::IndexedMesh> pIndexedMesh;
std::vector< unsigned int > face_color_per_vertex
Definition: IndexedMesh.h:24
Definition: Variant.h:60
LX_GEOM_EXPORT Base::AbstractWriter & operator<<(Base::AbstractWriter &os, Geom::IndexedMesh &op)
std::vector< Geom::Dir > face_per_vertex_normals
Definition: IndexedMesh.h:22
std::vector< long > face_coordinateIndices
Definition: IndexedMesh.h:20
void transform(Container container, OutputIt out, BinaryFunction function)
Definition: Algorithms.h:29
std::vector< Geom::Pnt > face_vertices
Definition: IndexedMesh.h:19
LX_GEOM_EXPORT std::istream & operator>>(std::istream &is, Geom::IndexedMesh &op)
Definition: Trsf.h:57
std::vector< unsigned int > wire_color_per_vertex
Definition: IndexedMesh.h:29
std::shared_ptr< Geom::IndexedMesh > pIndexedMesh
Definition: IndexedMesh.h:55
std::vector< long > wire_coordinateIndices
Definition: IndexedMesh.h:28
Definition: Writer.h:16
std::vector< Geom::Pnt > wire_vertices
Definition: IndexedMesh.h:27
LX_GEOM_EXPORT std::ostream & operator<<(std::ostream &os, Geom::IndexedMesh &op)
Definition: IndexedMesh.h:10