OpenLexocad  27.0
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 #include <Geom/Trsf2d.h>
8 
9 #include <boost/smart_ptr.hpp>
10 
11 
12 namespace Geom
13 {
15 {
16 public:
17  IndexedMesh(void);
18  IndexedMesh(const IndexedMesh& other);
19  IndexedMesh(const std::vector<int>& model, const std::vector<Geom::Pnt>& points);
20  virtual ~IndexedMesh(void);
21 
22  // SoIndexedFaceSet-Format
23  std::vector<Geom::Pnt> face_vertices;
24  std::vector<long> face_coordinateIndices;
25  // normals are obligatory, vbos!
26  std::vector<Geom::Dir> face_per_vertex_normals;
27  // color: 0xrrggbbaa
28  std::vector<unsigned int> face_color_per_vertex;
29 
30  // SoIndexedLineSet-Format
31  std::vector<Geom::Pnt> wire_vertices;
32  std::vector<long> wire_coordinateIndices;
33  std::vector<unsigned int> wire_color_per_vertex;
34 
35  IndexedMesh& operator=(const IndexedMesh&);
36  bool operator==(const IndexedMesh& c) const;
37 
38  virtual void transform(const Geom::Trsf& t);
39  void createEdges(const std::vector<int>& model, const std::vector<Geom::Pnt>& points);
40 
41  bool restore(const std::string& s);
42 
43  static bool setBinaryReadMode(bool on);
44  static bool setBinaryWriteMode(bool on);
45 };
46 
47 
48 
49 GEOM_EXPORT std::istream& operator>>(std::istream& is, Geom::IndexedMesh& op);
50 GEOM_EXPORT std::ostream& operator<<(std::ostream& os, Geom::IndexedMesh& op);
51 
52 
53 
54 } // namespace Geom
55 
56 
58 
59 typedef std::shared_ptr<Geom::IndexedMesh> pIndexedMesh;
std::vector< unsigned int > face_color_per_vertex
Definition: IndexedMesh.h:28
GEOM_EXPORT std::istream & operator>>(std::istream &is, Geom::IndexedMesh &op)
Definition: Rotation.h:5
std::vector< Geom::Dir > face_per_vertex_normals
Definition: IndexedMesh.h:26
std::vector< long > face_coordinateIndices
Definition: IndexedMesh.h:24
GEOM_EXPORT std::ostream & operator<<(std::ostream &os, Geom::IndexedMesh &op)
#define GEOM_EXPORT
Definition: geom_defines.h:8
GEOM_EXPORT Base::AbstractWriter & operator<<(Base::AbstractWriter &os, Geom::IndexedMesh &op)
std::vector< Geom::Pnt > face_vertices
Definition: IndexedMesh.h:23
Definition: Trsf.h:58
std::vector< unsigned int > wire_color_per_vertex
Definition: IndexedMesh.h:33
std::shared_ptr< Geom::IndexedMesh > pIndexedMesh
Definition: IndexedMesh.h:59
std::vector< long > wire_coordinateIndices
Definition: IndexedMesh.h:32
Definition: Writer.h:27
std::vector< Geom::Pnt > wire_vertices
Definition: IndexedMesh.h:31
Definition: IndexedMesh.h:14