45 #ifndef CMultiSegmentH 46 #define CMultiSegmentH 119 const bool a_duplicateTextureData =
false,
120 const bool a_duplicateMeshData =
false,
121 const bool a_buildCollisionDetector =
false);
132 unsigned int newVertex(
const double a_x = 0.0,
133 const double a_y = 0.0,
134 const double a_z = 0.0);
151 unsigned int newSegment(
const unsigned int a_indexVertex0,
152 const unsigned int a_indexVertex1);
178 const bool a_applyToVertices =
false,
179 const bool a_applyToTextures =
false,
180 const bool a_affectChildren =
false);
190 virtual void markForUpdate(
const bool a_affectChildren =
false);
209 void setLineStipple(
const GLint a_stippleFactor,
const GLushort a_stipplePattern);
238 void scaleXYZ(
const double a_scaleX,
const double a_scaleY,
const double a_scaleZ);
242 const bool a_updateCollisionDetector =
true);
268 const bool a_duplicateMaterialData =
false,
269 const bool a_duplicateTextureData =
false,
270 const bool a_duplicateMeshData =
false,
271 const bool a_buildCollisionDetector =
false);
274 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:633
This class implements a collection 3D segments.
Definition: CMultiSegment.h:96
GLint getLineStippleFactor()
This method returns the line stipple factor value.
Definition: CMultiSegment.h:212
virtual void render(cRenderOptions &a_options)
This method renders this object graphically using OpenGL.
Definition: CMultiSegment.cpp:658
virtual void renderSegments(cRenderOptions &a_options)
This method rendres all segments.
Definition: CMultiSegment.cpp:691
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:496
GLushort getLineStipplePattern()
This method returns the line stipple pattern value.
Definition: CMultiSegment.h:215
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:306
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:206
double m_lineWidth
Line width.
Definition: CMultiSegment.h:287
virtual void scaleObject(const double &a_scaleFactor)
This method scales this object by a scale factor.
Definition: CMultiSegment.h:274
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:545
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:203
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:290
cVertexArrayPtr m_vertices
Array of vertices.
Definition: CMultiSegment.h:303
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:141
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:516
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:284
Definition: CAudioBuffer.cpp:56
virtual void createBruteForceCollisionDetector()
This method builds a brute force collision detector for this mesh.
Definition: CMultiSegment.cpp:611
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:293
virtual void setTransparencyLevel(const float a_level, const bool a_applyToVertices=false, 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:467
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