47 #ifndef CMultiSegmentH
48 #define CMultiSegmentH
121 const bool a_duplicateTextureData =
false,
122 const bool a_duplicateMeshData =
false,
123 const bool a_buildCollisionDetector =
false);
134 unsigned int newVertex(
const double a_x = 0.0,
135 const double a_y = 0.0,
136 const double a_z = 0.0);
153 unsigned int newSegment(
const unsigned int a_indexVertex0,
154 const unsigned int a_indexVertex1);
180 const bool a_applyToTextures =
false,
181 const bool a_affectChildren =
false);
191 virtual void markForUpdate(
const bool a_affectChildren =
false);
210 void setLineStipple(
const GLint a_stippleFactor,
const GLushort a_stipplePattern);
239 void scaleXYZ(
const double a_scaleX,
const double a_scaleY,
const double a_scaleZ);
243 const bool a_updateCollisionDetector =
true);
269 const bool a_duplicateMaterialData =
false,
270 const bool a_duplicateTextureData =
false,
271 const bool a_duplicateMeshData =
false,
272 const bool a_buildCollisionDetector =
false);
275 virtual void scaleObject(
const double& a_scaleFactor) {
scaleXYZ(a_scaleFactor, a_scaleFactor, a_scaleFactor); }
This class implements a 3D vector.
Definition: CVector3d.h:88
This structures provide a containers for storing rendering options that are passed through the sceneg...
Definition: CRenderOptions.h:82
void clear()
This method clears all segments and vertices.
Definition: CMultiSegment.cpp:383
virtual void createAABBCollisionDetector(const double a_radius)
This method builds an AABB collision detector for this mesh.
Definition: CMultiSegment.cpp:630
This class implements a collection 3D segments.
Definition: CMultiSegment.h:98
GLint getLineStippleFactor()
This method returns the line stipple factor value.
Definition: CMultiSegment.h:213
virtual void render(cRenderOptions &a_options)
This method renders this object graphically using OpenGL.
Definition: CMultiSegment.cpp:655
virtual void renderSegments(cRenderOptions &a_options)
This method rendres all segments.
Definition: CMultiSegment.cpp:688
std::shared_ptr< cSegmentArray > cSegmentArrayPtr
Definition: CSegmentArray.h:65
void setLineColor(const cColorf &a_color)
This method sets the color of all segments.
Definition: CMultiSegment.cpp:489
GLushort getLineStipplePattern()
This method returns the line stipple pattern value.
Definition: CMultiSegment.h:216
virtual void updateGlobalPositions(const bool a_frameOnly)
This method updates the global position of each vertex.
Definition: CMultiSegment.cpp:424
bool removeSegment(const unsigned int a_index)
This method removes a selected segment.
Definition: CMultiSegment.cpp:366
virtual cVector3d getCenterOfMass()
This method computes the center of mass of this object, based on vertex positions.
Definition: CMultiSegment.cpp:215
cSegmentArrayPtr m_segments
Array of triangles.
Definition: CMultiSegment.h:307
virtual cMultiSegment * copy(const bool a_duplicateMaterialData=false, const bool a_duplicateTextureData=false, const bool a_duplicateMeshData=false, const bool a_buildCollisionDetector=false)
This method creates a copy of itself.
Definition: CMultiSegment.cpp:123
virtual ~cMultiSegment()
Destructor of cMultiSegment.
Definition: CMultiSegment.cpp:104
double getLineWidth() const
This method returns the line width.
Definition: CMultiSegment.h:207
double m_lineWidth
Line width.
Definition: CMultiSegment.h:288
virtual void scaleObject(const double &a_scaleFactor)
This method scales this object by a scale factor.
Definition: CMultiSegment.h:275
unsigned int newVertex(const double a_x=0.0, const double a_y=0.0, const double a_z=0.0)
This method creates a new vertex and adds it to the vertex list.
Definition: CMultiSegment.cpp:258
virtual void updateBoundaryBox()
This method updates the boundary box dimensions based on the vertices.
Definition: CMultiSegment.cpp:538
void setLineStipple(const GLint a_stippleFactor, const GLushort a_stipplePattern)
This method specifies the line stipple pattern.
This class implements a base class for all 2D or 3D objects in CHAI3D.
Definition: CGenericObject.h:112
void scaleXYZ(const double a_scaleX, const double a_scaleY, const double a_scaleZ)
This method scales this object by using different scale factors along X,Y and Z axes.
Definition: CMultiSegment.cpp:403
void setLineWidth(const double a_lineWidth)
This method sets the line width of all segments.
Definition: CMultiSegment.h:204
Implements a base class for all objects.
void copyMultiSegmentProperties(cMultiSegment *a_obj, const bool a_duplicateMaterialData=false, const bool a_duplicateTextureData=false, const bool a_duplicateMeshData=false, const bool a_buildCollisionDetector=false)
This method copies all properties of this object to another.
Definition: CMultiSegment.cpp:154
std::shared_ptr< cVertexArray > cVertexArrayPtr
Definition: CVertexArray.h:107
This class defines a color using a GLfloat representation for each component.
Definition: CColor.h:138
Implements color properties.
GLint m_stippleFactor
Specifies a multiplier for each bit in the line stipple pattern.
Definition: CMultiSegment.h:291
cVertexArrayPtr m_vertices
Array of vertices.
Definition: CMultiSegment.h:304
unsigned int getNumSegments()
This method returns the number of stored segments.
Definition: CMultiSegment.cpp:241
Implements material properties.
unsigned int getNumVertices() const
This method returns the number of stored vertices.
Definition: CMultiSegment.h:143
virtual void offsetVertices(const cVector3d &a_offset, const bool a_updateCollisionDetector=true)
This method shifts all vertex positions by the specified amount.
Definition: CMultiSegment.cpp:509
virtual void markForUpdate(const bool a_affectChildren=false)
This method invalidates any existing display lists and marks the mesh for update. ...
Definition: CMultiSegment.cpp:446
bool m_showSegments
If true, then segments are displayed.
Definition: CMultiSegment.h:285
Definition: CAudioBuffer.cpp:56
virtual void setTransparencyLevel(const float a_level, const bool a_applyToTextures=false, const bool a_affectChildren=false)
This method sets the alpha value at each vertex and in all of my material colors. ...
Definition: CMultiSegment.cpp:466
virtual void createBruteForceCollisionDetector()
This method builds a brute force collision detector for this mesh.
Definition: CMultiSegment.cpp:604
cMultiSegment()
Constructor of cMultiSegment.
Definition: CMultiSegment.cpp:70
GLushort m_stipplePattern
Specifies a 16-bit integer whose bit pattern determine which fragments of a line will be drawn when t...
Definition: CMultiSegment.h:294
unsigned int newSegment(const unsigned int a_indexVertex0, const unsigned int a_indexVertex1)
This method creates a new segment by passing two vertex indices.
Definition: CMultiSegment.cpp:306