OpenLexocad  28.0
IndexedMesh.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Geom/Dir.h>
4 #include <Geom/Pnt.h>
5 #include <memory>
6 
7 namespace Base
8 {
9 class AbstractWriter;
10 }
11 
12 namespace Geom
13 {
14 class LX_GEOM_EXPORT IndexedMesh
15 {
16 public:
18  IndexedMesh(const IndexedMesh& other);
19  IndexedMesh(const std::vector<int>& model, const std::vector<Geom::Pnt>& points);
20  virtual ~IndexedMesh();
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 
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  LX_GEOM_EXPORT std::istream& operator>>(std::istream& is, Geom::IndexedMesh& op);
50  LX_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;
Geom::operator>>
LX_GEOM_EXPORT std::istream & operator>>(std::istream &is, Geom::IndexedMesh &op)
Geom::IndexedMesh::createEdges
void createEdges(const std::vector< int > &model, const std::vector< Geom::Pnt > &points)
Geom::IndexedMesh::IndexedMesh
IndexedMesh(const std::vector< int > &model, const std::vector< Geom::Pnt > &points)
Geom::IndexedMesh::wire_color_per_vertex
std::vector< unsigned int > wire_color_per_vertex
Definition: IndexedMesh.h:33
Geom::operator<<
LX_GEOM_EXPORT std::ostream & operator<<(std::ostream &os, Geom::IndexedMesh &op)
operator<<
LX_GEOM_EXPORT Base::AbstractWriter & operator<<(Base::AbstractWriter &os, Geom::IndexedMesh &op)
Geom::IndexedMesh::IndexedMesh
IndexedMesh(const IndexedMesh &other)
Geom::IndexedMesh::wire_coordinateIndices
std::vector< long > wire_coordinateIndices
Definition: IndexedMesh.h:32
Geom::IndexedMesh::wire_vertices
std::vector< Geom::Pnt > wire_vertices
Definition: IndexedMesh.h:31
Geom::IndexedMesh::restore
bool restore(const std::string &s)
Geom::IndexedMesh::~IndexedMesh
virtual ~IndexedMesh()
Geom::IndexedMesh::setBinaryWriteMode
static bool setBinaryWriteMode(bool on)
Geom::IndexedMesh::face_color_per_vertex
std::vector< unsigned int > face_color_per_vertex
Definition: IndexedMesh.h:28
Base::AbstractWriter
Definition: Writer.h:13
Geom::IndexedMesh::IndexedMesh
IndexedMesh()
Pnt.h
pIndexedMesh
std::shared_ptr< Geom::IndexedMesh > pIndexedMesh
Definition: IndexedMesh.h:59
Geom::IndexedMesh::face_coordinateIndices
std::vector< long > face_coordinateIndices
Definition: IndexedMesh.h:24
Geom::IndexedMesh::setBinaryReadMode
static bool setBinaryReadMode(bool on)
Geom::IndexedMesh::face_per_vertex_normals
std::vector< Geom::Dir > face_per_vertex_normals
Definition: IndexedMesh.h:26
Geom::IndexedMesh::transform
virtual void transform(const Geom::Trsf &t)
Geom::Trsf
Definition: Trsf.h:58
Geom::IndexedMesh::operator==
bool operator==(const IndexedMesh &c) const
Geom::IndexedMesh::face_vertices
std::vector< Geom::Pnt > face_vertices
Definition: IndexedMesh.h:23
Dir.h
Geom::IndexedMesh::operator=
IndexedMesh & operator=(const IndexedMesh &)
Geom::IndexedMesh
Definition: IndexedMesh.h:15
Base
Definition: AbstractXMLReader.h:5
Geom
Definition: PropertyContainer.h:33