AGX Dynamics  2.38.0.2
RawMesh.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXUTIL_RAWMESH_H
18 #define AGXUTIL_RAWMESH_H
19 
20 #include <agx/Vec3.h>
21 #include <vector>
22 #include <agx/Vector.h>
23 #include <agx/Referenced.h>
24 #include <agxStream/Serializable.h>
25 
26 namespace agxUtil
27 {
30 
35  {
36  public:
38 
39  // Used for serialization
40  RawMesh();
41 
42  RawMesh(const agx::String& meshName);
43 
49  size_t getNumVertices() const;
50 
55  size_t getNumFaces() const;
56 
62  size_t addVertex(const agx::Vec3& position);
63 
70  size_t addFace(const IndexVector& vertices);
71 
77  agx::Vec3 getVertexPosition(size_t vertex) const;
78 
87  agx::Real getFaceArea(size_t face) const;
88 
93  agx::Real getVertexArea(size_t vertex) const;
98  agx::Real getTotalArea() const;
99 
104  const IndexVector& getFaceVertices(size_t face) const;
105 
111  const IndexVector& getFacesFromVertex(size_t vertex) const;
112 
117  const agx::String& getName() const;
118 
120 
121  private:
122  agx::Real calculateFaceArea(size_t face) const;
123 
124  private:
125  agx::String m_name;
126  agx::Real m_totalArea;
127 
128  agx::Vector<agx::Vec3> m_vertices;
129  agx::Vector<agx::Real> m_vertexAreas;
130  agx::Vector< IndexVector > m_vertexToFaces;
131 
133  agx::Vector<agx::Real> m_faceAreas;
134  };
135 }
136 
137 #endif
138 
Referenced.h
agx::Real
double Real
Definition: Real.h:42
Vector.h
agx::Vector
Templated vector class.
Definition: Vector.h:52
agxStream::Serializable
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
AGXSTREAM_DECLARE_SERIALIZABLE
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
agx::VectorPOD
Vector containing 'raw' data.
Definition: Vector.h:245
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
AGX_DECLARE_VECTOR_TYPES
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34
Vec3.h
Serializable.h
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:119
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::AgXString< std::string >
agx::Vec3T< Real >
agxUtil::RawMesh::IndexVector
agx::VectorPOD< agx::UInt > IndexVector
Definition: RawMesh.h:37
agxUtil::RawMesh
A class to hold a general represenation of a mesh with arbitrary number of vertices in a face.
Definition: RawMesh.h:34
agxUtil
The agxUtil namespace contain classes and methods for utility functionality.
Definition: CylindricalJoint.h:20