#include <TAPsOpenGLHETriMeshOneModelMultiParts.hpp>


Public Member Functions | |
| void | DrawFromListOfVertex () |
| OpenGLHETriMeshOneModelMultiParts () | |
| virtual void | ToggleDisplayVertexNormals () |
| virtual | ~OpenGLHETriMeshOneModelMultiParts () |
Protected Member Functions | |
| virtual void | DrawGL (GLenum) |
| void | DrawGLParticleRef (int partNo=-1) |
| void | DrawGLSpringConnections (int partNo=-1) |
| void | DrawGLSprings (int partNo=-1) |
| void | DrawGLVertexRing1 (int partNo=-1) |
| void | DrawVertexSimulationStatus () |
Protected Attributes | |
| bool | bIsDisplayVertexNormals |
Friends | |
| std::ostream & | operator<< (std::ostream &output, OpenGLHETriMeshOneModelMultiParts< T > const &o) |
See class HalfEdgeModel (in "../OpenGLModel/TAPsHalfEdgeModel.hpp") and class OpenGLSupport ("../OpenGL/TAPsOpenGLSupport.hpp") for details.
Definition at line 22 of file TAPsOpenGLHETriMeshOneModelMultiParts.hpp.
| BEGIN_NAMESPACE_TAPs__OpenGL OpenGLHETriMeshOneModelMultiParts< T >::OpenGLHETriMeshOneModelMultiParts | ( | ) | [inline] |
Definition at line 21 of file TAPsOpenGLHETriMeshOneModelMultiParts.cpp.
00022 : HETriMeshOneModelMultiParts<T>(), bIsDisplayVertexNormals( false ) 00023 { 00024 #ifdef TAPs_DEBUG_MODE 00025 std::cout << "OpenGLHETriMeshOneModelMultiParts<" << typeid(T).name() << "> constructor\n"; 00026 #endif//TAPs_DEBUG_MODE 00027 }
| OpenGLHETriMeshOneModelMultiParts< T >::~OpenGLHETriMeshOneModelMultiParts | ( | ) | [inline, virtual] |
Definition at line 31 of file TAPsOpenGLHETriMeshOneModelMultiParts.cpp.
00032 { 00033 #ifdef TAPs_DEBUG_MODE 00034 std::cout << "OpenGLHETriMeshOneModelMultiParts<" << typeid(T).name() << "> destructor\n"; 00035 #endif//TAPs_DEBUG_MODE 00036 }
| void OpenGLHETriMeshOneModelMultiParts< T >::DrawFromListOfVertex | ( | ) | [inline] |
Definition at line 76 of file TAPsOpenGLHETriMeshOneModelMultiParts.hpp.
00076 { 00077 Vector3<T> pos; 00078 glPointSize( 3 ); 00079 glBegin( GL_POINTS ); 00080 for ( int i = 0; i < GetNoVertices(); ++i ) { 00081 pos = *m_vListOfVertexPositions[i]; 00082 glVertex3f ( pos[0], pos[1], pos[2] ); 00083 } 00084 glEnd(); 00085 glPointSize( 1 ); 00086 }
| void OpenGLHETriMeshOneModelMultiParts< T >::DrawGL | ( | GLenum | drawMode | ) | [inline, protected, virtual] |
Implements OpenGLSupport.
Definition at line 74 of file TAPsOpenGLHETriMeshOneModelMultiParts.cpp.
00075 { 00076 #ifdef TAPs_USE_DATA_POOL 00077 glPushClientAttrib( GL_CLIENT_VERTEX_ARRAY_BIT ); 00078 #endif//TAPs_USE_DATA_POOL 00079 //--------------------------------------------------------------- 00080 if ( drawMode == OpenGL::Enum::POINT ) { 00081 00082 #ifdef TAPs_USE_DATA_POOL 00083 glEnableClientState( GL_VERTEX_ARRAY ); 00084 if ( typeid(T) == typeid(float) ) 00085 { 00086 glVertexPointer( 3, GL_FLOAT, 0, GetArrayOfVertexPositions().GetAddressOfDataNumber(0) ); 00087 } 00088 else //if ( typeid(T) == typeid(double) ) 00089 { 00090 glVertexPointer( 3, GL_DOUBLE, 0, GetArrayOfVertexPositions().GetAddressOfDataNumber(0) ); 00091 } 00092 glPointSize( 2 ); 00093 glDrawArrays( GL_POINTS, 0, GetArrayOfVertexPositions().GetSize() ); 00094 00095 #else //TAPs_USE_DATA_POOL 00096 HEVertex<T> *ptr = m_listVertex->Head(); 00097 glBegin( drawMode ); 00098 while ( ptr != NULL ) { 00099 // Draw the vertex 00100 glVertex3f ( 00101 static_cast<float>( (*ptr)[0] ), 00102 static_cast<float>( (*ptr)[1] ), 00103 static_cast<float>( (*ptr)[2] ) ); 00104 ptr = ptr->Next(); 00105 } 00106 glEnd(); 00107 00108 #endif//TAPs_USE_DATA_POOL 00109 00110 } 00111 else if ( isFacetShading ) { 00112 // Draw the object 00113 //glEnable( GL_TEXTURE_2D ); 00114 HEFace<T> *facePtr = m_listFace->Head(); 00115 HEHalfEdge<T> *halfEdgePtr; 00116 //for ( int f = 0; f < GetNoFaces(); ++f ) { 00117 while ( facePtr != NULL ) { 00118 00119 // Submaterial supported by .ASE 00120 #ifdef TAPs_SUPPORT_ASE_FORMAT 00121 int matID = facePtr->GetMaterialID(); 00122 if ( matID < static_cast<int>( this->submaterials.size() ) ) { 00123 this->submaterials[ matID ]->ApplyMaterial(); 00124 } 00125 #endif//TAPs_SUPPORT_ASE_FORMAT 00126 00127 halfEdgePtr = facePtr->IncidentHalfEdge(); 00128 glBegin( drawMode ); 00129 //for ( int i = 0; i < 3; ++i ) { 00130 do { 00132 //if ( m_prFace[i].GetNoTexCoords() != 0 ) { 00133 // glTexCoord2f( static_cast<float>( m_prFace[i].GetTexCoordHalfNo( j*2 ) ), 00134 // static_cast<float>( m_prFace[i].GetTexCoordHalfNo( j*2+1 ) ) ); 00135 //} 00136 // Normal of the face 00137 glNormal3f ( 00138 static_cast<float>( facePtr->GetNormal()[0] ), 00139 static_cast<float>( facePtr->GetNormal()[1] ), 00140 static_cast<float>( facePtr->GetNormal()[2] ) 00141 ); 00142 // Draw the vertex 00143 glVertex3f ( 00144 static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[0] ), 00145 static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[1] ), 00146 static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[2] ) 00147 ); 00148 // DEBUG: 00149 //std::cout << halfEdgePtr->Vertex()->GetPosition()[0]; 00150 //std::cout << halfEdgePtr->Vertex()->GetPosition()[1]; 00151 //std::cout << halfEdgePtr->Vertex()->GetPosition()[2]; 00152 //std::cout << "\n"; 00153 halfEdgePtr = halfEdgePtr->Next(); 00154 } while ( halfEdgePtr != facePtr->IncidentHalfEdge() ); 00155 //std::cout << "\n"; 00156 //} 00157 glEnd(); 00158 facePtr = facePtr->Next(); 00159 } 00160 00161 // Draw the object 00162 //for ( int i = 0; i < m_iNoFaces; i++ ) 00163 //{ 00164 // glBegin( drawMode ); 00165 // for ( int j = 0; j < m_prFace[i].GetNoVertices(); ++j ) 00166 // { 00167 // // Draw texture 00168 // if ( m_prFace[i].GetNoTexCoords() != 0 ) { 00169 // glTexCoord2f( static_cast<float>( m_prFace[i].GetTexCoordHalfNo( j*2 ) ), 00170 // static_cast<float>( m_prFace[i].GetTexCoordHalfNo( j*2+1 ) ) ); 00171 // } 00172 // // Normal of the face 00173 // //glNormal3f ( static_cast<float>( m_prFace[i].GetNormal()[0] ), 00174 // // static_cast<float>( m_prFace[i].GetNormal()[1] ), 00175 // // static_cast<float>( m_prFace[i].GetNormal()[2] ) ); 00176 // // Draw the vertex 00177 // glVertex3f ( 00178 // static_cast<float>( m_prXVertex[ m_prFace[i].GetVertexNo( j ) ][0] ), 00179 // static_cast<float>( m_prXVertex[ m_prFace[i].GetVertexNo( j ) ][1] ), 00180 // static_cast<float>( m_prXVertex[ m_prFace[i].GetVertexNo( j ) ][2] ) ); 00181 // } 00182 // glEnd(); 00183 //} 00185 } 00186 else { 00187 // Draw the object 00188 00189 #ifdef TAPs_USE_DATA_POOL 00190 glEnableClientState( GL_VERTEX_ARRAY ); 00191 glEnableClientState( GL_NORMAL_ARRAY ); 00192 if ( typeid(T) == typeid(float) ) 00193 { 00194 glVertexPointer( 3, GL_FLOAT, 0, GetArrayOfVertexPositions().GetAddressOfDataNumber(0) ); 00195 glNormalPointer( GL_FLOAT, 0, GetArrayOfVertexNormals().GetAddressOfDataNumber(0) ); 00196 } 00197 else //if ( typeid(T) == typeid(double) ) 00198 { 00199 glVertexPointer( 3, GL_DOUBLE, 0, GetArrayOfVertexPositions().GetAddressOfDataNumber(0) ); 00200 glNormalPointer( GL_DOUBLE, 0, GetArrayOfVertexNormals().GetAddressOfDataNumber(0) ); 00201 } 00202 00203 #ifdef TAPs_SUPPORT_ASE_FORMAT 00204 int i = 0; 00205 HEFace<T> *facePtr = m_listFace->Head(); 00206 while ( facePtr != NULL ) { 00207 00208 // Submaterial supported by .ASE 00209 int matID = facePtr->GetMaterialID(); 00210 if ( matID < static_cast<int>( this->submaterials.size() ) ) { 00211 this->submaterials[ matID ]->ApplyMaterial(); 00212 } 00213 glDrawElements( 00214 GL_TRIANGLES, 00215 3, 00216 GL_UNSIGNED_INT, 00217 GetArrayOfIndexFaces().GetAddressOfDataNumber(i++) 00218 ); 00219 facePtr = facePtr->Next(); 00220 } 00221 #else //TAPs_SUPPORT_ASE_FORMAT 00222 glDrawElements( 00223 GL_TRIANGLES, 00224 GetArrayOfIndexFaces().GetSize()*GetArrayOfIndexFaces().GetStride(), 00225 GL_UNSIGNED_INT, 00226 GetArrayOfIndexFaces().GetAddressOfDataNumber(0) 00227 ); 00228 #endif//TAPs_SUPPORT_ASE_FORMAT 00229 00230 #else //TAPs_USE_DATA_POOL 00231 //glEnable( GL_TEXTURE_2D ); 00232 HEFace<T> *facePtr = m_listFace->Head(); 00233 HEHalfEdge<T> *halfEdgePtr; 00234 //for ( int f = 0; f < GetNoFaces(); ++f ) { 00235 while ( facePtr != NULL ) { 00236 00237 // Submaterial supported by .ASE 00238 #ifdef TAPs_SUPPORT_ASE_FORMAT 00239 int matID = facePtr->GetMaterialID(); 00240 if ( matID < static_cast<int>( this->submaterials.size() ) ) { 00241 this->submaterials[ matID ]->ApplyMaterial(); 00242 } 00243 #endif//TAPs_SUPPORT_ASE_FORMAT 00244 00245 halfEdgePtr = facePtr->IncidentHalfEdge(); 00246 glBegin( drawMode ); 00247 //for ( int i = 0; i < 3; ++i ) { 00248 do { 00250 //if ( m_prFace[i].GetNoTexCoords() != 0 ) { 00251 // glTexCoord2f( static_cast<float>( m_prFace[i].GetTexCoordHalfNo( j*2 ) ), 00252 // static_cast<float>( m_prFace[i].GetTexCoordHalfNo( j*2+1 ) ) ); 00253 //} 00255 glNormal3f ( 00256 static_cast<float>( halfEdgePtr->Vertex()->GetNormal()[0] ), 00257 static_cast<float>( halfEdgePtr->Vertex()->GetNormal()[1] ), 00258 static_cast<float>( halfEdgePtr->Vertex()->GetNormal()[2] ) 00259 ); 00260 // Draw the vertex 00261 glVertex3f ( 00262 static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[0] ), 00263 static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[1] ), 00264 static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[2] ) 00265 ); 00266 // DEBUG: 00267 //std::cout << halfEdgePtr->Vertex()->GetPosition()[0]; 00268 //std::cout << halfEdgePtr->Vertex()->GetPosition()[1]; 00269 //std::cout << halfEdgePtr->Vertex()->GetPosition()[2]; 00270 //std::cout << "\n"; 00271 halfEdgePtr = halfEdgePtr->Next(); 00272 } while ( halfEdgePtr != facePtr->IncidentHalfEdge() ); 00273 //std::cout << "\n"; 00274 //} 00275 glEnd(); 00276 facePtr = facePtr->Next(); 00277 } 00278 00279 #endif//TAPs_USE_DATA_POOL 00280 00283 //for ( int i = 0; i < m_iNoFaces; i++ ) 00284 //{ 00285 // glBegin( drawMode ); 00286 // for ( int j = 0; j < m_prFace[i].GetNoVertices(); ++j ) 00287 // { 00288 // // Draw texture 00289 // if ( m_prFace[i].GetNoTexCoords() != 0 ) { 00290 // glTexCoord2f( static_cast<float>( m_prFace[i].GetTexCoordHalfNo( j*2 ) ), 00291 // static_cast<float>( m_prFace[i].GetTexCoordHalfNo( j*2+1 ) ) ); 00292 // } 00293 // // Normal of the vertex 00294 // glNormal3f ( static_cast<float>( m_prXVertex[ m_prFace[i].GetVertexNo( j ) ].GetNormal()[0] ), 00295 // static_cast<float>( m_prXVertex[ m_prFace[i].GetVertexNo( j ) ].GetNormal()[1] ), 00296 // static_cast<float>( m_prXVertex[ m_prFace[i].GetVertexNo( j ) ].GetNormal()[2] ) ); 00297 // // Draw the vertex 00298 // glVertex3f ( 00299 // static_cast<float>( m_prXVertex[ m_prFace[i].GetVertexNo( j ) ][0] ), 00300 // static_cast<float>( m_prXVertex[ m_prFace[i].GetVertexNo( j ) ][1] ), 00301 // static_cast<float>( m_prXVertex[ m_prFace[i].GetVertexNo( j ) ][2] ) ); 00302 // } 00303 // glEnd(); 00304 //} 00306 } 00307 00308 // Draw Boundary 00309 //if ( drawMode == OpenGL::Enum::POLYGON_WITH_WIRE_FRAME ) { 00310 //if ( true ) { 00311 // glColor3f( 1.0f, 0.0f, 0.0f ); 00312 // glDisable( GL_LIGHTING ); 00313 // glBegin( GL_LINES ); 00314 // HEFace<T> *facePtr = m_listFace->Head(); 00315 // HEHalfEdge<T> *halfEdgePtr; 00316 // while ( facePtr != NULL ) { 00317 // halfEdgePtr = facePtr->IncidentHalfEdge(); 00318 // do { 00319 // if ( !halfEdgePtr->Pair() ) { 00320 // // Draw the vertex 00321 // glVertex3f ( 00322 // static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[0] ), 00323 // static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[1] ), 00324 // static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[2] ) 00325 // ); 00326 // glVertex3f ( 00327 // static_cast<float>( halfEdgePtr->Next()->Vertex()->GetPosition()[0] ), 00328 // static_cast<float>( halfEdgePtr->Next()->Vertex()->GetPosition()[1] ), 00329 // static_cast<float>( halfEdgePtr->Next()->Vertex()->GetPosition()[2] ) 00330 // ); 00331 // } 00332 // halfEdgePtr = halfEdgePtr->Next(); 00333 // } while ( halfEdgePtr != facePtr->IncidentHalfEdge() ); 00334 // facePtr = facePtr->Next(); 00335 // } 00336 // glEnd(); 00337 // glEnable( GL_LIGHTING ); 00338 //} 00339 00340 // Draw Boundary 00341 if ( true ) { 00342 glColor3f( 1.0f, 0.0f, 0.0f ); 00343 glPushAttrib( GL_LIGHTING_BIT ); 00344 glDisable( GL_LIGHTING ); 00345 glBegin( GL_LINES ); 00346 if ( m_listHoleFace != NULL ) { 00347 HEFace<T> *facePtr = m_listHoleFace->Head(); 00348 HEHalfEdge<T> *halfEdgePtr; 00349 while ( facePtr != NULL ) { 00350 halfEdgePtr = facePtr->IncidentHalfEdge(); 00351 do { 00352 //if ( halfEdgePtr && halfEdgePtr->Next() ) { 00353 // Draw the vertex 00354 glVertex3f ( 00355 static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[0] ), 00356 static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[1] ), 00357 static_cast<float>( halfEdgePtr->Vertex()->GetPosition()[2] ) 00358 ); 00359 glVertex3f ( 00360 static_cast<float>( halfEdgePtr->Next()->Vertex()->GetPosition()[0] ), 00361 static_cast<float>( halfEdgePtr->Next()->Vertex()->GetPosition()[1] ), 00362 static_cast<float>( halfEdgePtr->Next()->Vertex()->GetPosition()[2] ) 00363 ); 00364 //} 00365 halfEdgePtr = halfEdgePtr->Next(); 00366 } while ( halfEdgePtr && halfEdgePtr != facePtr->IncidentHalfEdge() ); 00367 facePtr = facePtr->Next(); 00368 } 00369 } 00370 glEnd(); 00371 //glEnable( GL_LIGHTING ); 00372 glPopAttrib(); 00373 } 00374 00375 if ( bIsDisplayVertexNormals ) { 00376 glColor3ub( 75, 200, 100 ); 00377 glPushAttrib( GL_LIGHTING_BIT ); 00378 glDisable( GL_LIGHTING ); 00379 //HEVertex<T> * pVertex = GetVertexList(); 00380 HEVertex<T> * pVertex = m_listVertex->Head(); 00381 while ( pVertex ) { 00382 Fn::Draw3DLine( pVertex->GetPosition(), pVertex->GetPosition() + pVertex->GetNormal() ); 00383 pVertex = pVertex->Next(); 00384 } 00385 //glEnable( GL_LIGHTING ); 00386 glPopAttrib(); 00387 } 00388 00389 #ifdef TAPs_DEBUG_CD_WITH_HETRI 00390 for ( int i = 0; i < static_cast<int>( m_Parts.size() ); ++i ) { 00391 DrawGLParticleRef( i ); 00392 if ( m_Parts[i].GetModelType() == TAPs::Enum::MODEL_DEFORM ) { 00393 DrawGLSprings( i ); 00394 } 00395 } 00396 #endif//TAPs_DEBUG_CD_WITH_HETRI 00397 00398 00399 DrawVertexSimulationStatus(); 00400 00401 00402 //DrawGLParticleRef(); 00403 //DrawGLVertexRing1(); 00404 //DrawGLSpringConnections(); 00405 //DrawGLSprings(); 00406 00407 //DrawGLHalfEdges(); 00408 00409 // Draw AABB Bounding Box 00410 //DrawBoundingAABB(); 00411 //DrawBoundingEllipsoid(); 00412 //DrawBoundingSphere(); 00413 //--------------------------------------------------------------- 00414 #ifdef TAPs_USE_DATA_POOL 00415 glPopClientAttrib(); 00416 #endif//TAPs_USE_DATA_POOL 00417 }
| void OpenGLHETriMeshOneModelMultiParts< T >::DrawGLParticleRef | ( | int | partNo = -1 |
) | [inline, protected] |
Definition at line 1096 of file TAPsOpenGLHETriMeshOneModelMultiParts.cpp.
01097 { 01098 // Draw whole model 01099 if ( partNo < 0 ) { 01100 if ( !m_pHEVertexList->empty() ) { 01101 glPushAttrib( GL_CURRENT_BIT | GL_LIGHTING_BIT ); 01102 glDisable( GL_LIGHTING ); 01103 glColor3f( 0, 1, 0 ); 01104 glPointSize( 2 ); 01105 glPushMatrix(); 01106 glBegin( GL_POINTS ); 01107 for ( int i = 0; i < static_cast<int>( m_pHEVertexList->size() ); ++i ) { 01108 glVertex3fv( (*m_pHEVertexList)[i]->GetParticleRef()->GetPosition().GetDataFloat() ); 01109 } 01110 glEnd(); 01111 glPopMatrix(); 01112 glPopAttrib(); 01113 } 01114 } 01115 // Draw a part 01116 else if ( partNo < static_cast<int>( m_Parts.size() ) ) { 01117 float color = 1.0f / static_cast<float>( m_Parts.size() ); 01118 Vector3<float> vColor( 1.0f-(color*(partNo+1)), 0.0f, color*(partNo+1) ); 01119 glPushAttrib( GL_CURRENT_BIT | GL_LIGHTING_BIT ); 01120 glDisable( GL_LIGHTING ); 01121 glColor3f( vColor[0], vColor[1], vColor[2] ); 01122 glPointSize( 2 ); 01123 glPushMatrix(); 01124 glBegin( GL_POINTS ); 01125 for ( int i = 0; i < static_cast<int>( m_Parts[partNo].GetVertexList().size() ); ++i ) { 01126 glVertex3fv( m_Parts[partNo].GetVertexList()[i]->GetParticleRef()->GetPosition().GetDataFloat() ); 01127 } 01128 glEnd(); 01129 glPopMatrix(); 01130 glPopAttrib(); 01131 01132 01133 /* 01134 // DEBUG 01135 glPushAttrib( GL_CURRENT_BIT | GL_LIGHTING_BIT ); 01136 glDisable( GL_LIGHTING ); 01137 glColor3f( 1, 0, 0 ); 01138 glPointSize( 7 ); 01139 glPushMatrix(); 01140 glBegin( GL_POINTS ); 01141 for ( int i = 0; i < static_cast<int>( m_Parts[partNo].GetVertexList().size() ); ++i ) { 01142 glVertex3fv( m_Parts[partNo].GetVertexList()[i]->GetHomePosition().GetDataFloat() ); 01143 } 01144 glEnd(); 01145 glPopMatrix(); 01146 glPopAttrib(); 01147 //*/ 01148 } 01149 }
| void OpenGLHETriMeshOneModelMultiParts< T >::DrawGLSpringConnections | ( | int | partNo = -1 |
) | [inline, protected] |
Definition at line 1180 of file TAPsOpenGLHETriMeshOneModelMultiParts.cpp.
01181 { 01182 for ( int i = 0; i < static_cast<int>( m_vpSpringRef.size() ); ++i ) { 01183 glPushAttrib( GL_CURRENT_BIT | GL_LIGHTING_BIT ); 01184 glDisable( GL_LIGHTING ); 01185 glColor3f( 0, 0.5, 1 ); 01186 glLineWidth( 1 ); 01187 glPushMatrix(); 01188 glBegin( GL_LINES ); 01189 glVertex3f( m_vpSpringRef[i]->GetParticleOne().GetPosition()[0], 01190 m_vpSpringRef[i]->GetParticleOne().GetPosition()[1], 01191 m_vpSpringRef[i]->GetParticleOne().GetPosition()[2] ); 01192 glVertex3f( m_vpSpringRef[i]->GetParticleTwo().GetPosition()[0], 01193 m_vpSpringRef[i]->GetParticleTwo().GetPosition()[1], 01194 m_vpSpringRef[i]->GetParticleTwo().GetPosition()[2] ); 01195 glEnd(); 01196 glPopMatrix(); 01197 glPopAttrib(); 01198 } 01199 }
| void OpenGLHETriMeshOneModelMultiParts< T >::DrawGLSprings | ( | int | partNo = -1 |
) | [inline, protected] |
Definition at line 1203 of file TAPsOpenGLHETriMeshOneModelMultiParts.cpp.
01204 { 01205 // Draw whole model 01206 if ( partNo < 0 ) { 01207 for ( int i = 0; i < static_cast<int>( m_vpSpringRef.size() ); ++i ) { 01208 m_vpSpringRef[i]->DrawByOpenGL(); 01209 } 01210 } 01211 // Draw a part 01212 else if ( partNo < static_cast<int>( m_Parts.size() ) ) { 01213 for ( int i = 0; i < static_cast<int>( m_Parts[partNo].GetSpringList().size() ); ++i ) { 01214 m_Parts[partNo].GetSpringList()[i]->DrawByOpenGL(); 01215 } 01216 } 01217 }
| void OpenGLHETriMeshOneModelMultiParts< T >::DrawGLVertexRing1 | ( | int | partNo = -1 |
) | [inline, protected] |
Definition at line 1153 of file TAPsOpenGLHETriMeshOneModelMultiParts.cpp.
01154 { 01155 glPushAttrib( GL_CURRENT_BIT | GL_LIGHTING_BIT ); 01156 glDisable( GL_LIGHTING ); 01157 glColor3f( 0, 0.5, 1 ); 01158 glLineWidth( 1 ); 01159 glPushMatrix(); 01160 glBegin( GL_LINES ); 01161 for ( int i = 0; i < static_cast<int>( m_vpHEVertex.size() ); ++i ) { 01162 int k; 01163 for ( int j = 0; j < static_cast<int>( m_pviListVertexRing1[i].size() ); ++j ) { 01164 glVertex3f( m_vpHEVertex[i]->GetPosition()[0], 01165 m_vpHEVertex[i]->GetPosition()[1], 01166 m_vpHEVertex[i]->GetPosition()[2] ); 01167 k = m_pviListVertexRing1[i][j]; 01168 glVertex3f( m_vpHEVertex[k]->GetPosition()[0], 01169 m_vpHEVertex[k]->GetPosition()[1], 01170 m_vpHEVertex[k]->GetPosition()[2] ); 01171 } 01172 } 01173 glEnd(); 01174 glPopMatrix(); 01175 glPopAttrib(); 01176 }
| void OpenGLHETriMeshOneModelMultiParts< T >::DrawVertexSimulationStatus | ( | ) | [inline, protected] |
| virtual void OpenGLHETriMeshOneModelMultiParts< T >::ToggleDisplayVertexNormals | ( | ) | [inline, virtual] |
Reimplemented from OpenGLModel< T >.
Definition at line 97 of file TAPsOpenGLHETriMeshOneModelMultiParts.hpp.
00098 { bIsDisplayVertexNormals = !bIsDisplayVertexNormals; }
| std::ostream& operator<< | ( | std::ostream & | output, | |
| OpenGLHETriMeshOneModelMultiParts< T > const & | o | |||
| ) | [friend] |
Definition at line 25 of file TAPsOpenGLHETriMeshOneModelMultiParts.hpp.
00026 { 00027 output << "\n======================\n" 00028 << "TAPs::OpenGL::OpenGLHETriMeshOneModelMultiParts<" 00029 << typeid(T).name() << "> Class\n" 00030 << "======================\n"; 00031 //----------------------------------------------------------- 00032 /* 00033 // Material Node from OpenGLSupport 00034 output << "\nMaterial Node" << "\n{\n" << o.material << "\n}"; 00035 //----------------------------------------------------------- 00036 // Nodes from XPolygonalModel<T> 00037 output << "\n\nVertices " << o.m_iNoVertices << "\n{"; 00038 for ( int i = 0; i < o.m_iNoVertices; ++i ) { 00039 output << "\n #" << i << "\t" << o.m_prXVertex[i]; 00040 } 00041 output << "\n}"; 00042 //----------------------------------------------------------- 00043 // Neighbor vertex ring#1 00044 if ( o.m_pviVertexRing1List ) { 00045 std::vector<int>::const_iterator iterator; 00046 output << "\n\nVertexRing1 " << o.m_iNoVertices << "\n{"; 00047 for ( int i = 0; i < o.m_iNoVertices; ++i ) { 00048 output << "\n #" << i; 00049 for ( iterator = o.m_pviVertexRing1List[i].begin(); 00050 iterator != o.m_pviVertexRing1List[i].end(); 00051 ++iterator ) 00052 { 00053 output << "\t" << *iterator; 00054 } 00055 } 00056 output << "\n}"; 00057 } 00058 //----------------------------------------------------------- 00059 // Faces Node 00060 output << "\n\nFaces " << o.m_iNoFaces << "\n{"; 00061 for ( int i = 0; i < o.m_iNoFaces; ++i ) { 00062 output << "\n #" << i << "\t" << o.m_prFace[i]; 00063 } 00064 output << "\n}"; 00065 */ 00066 return output; 00067 }
bool OpenGLHETriMeshOneModelMultiParts< T >::bIsDisplayVertexNormals [protected] |
Definition at line 147 of file TAPsOpenGLHETriMeshOneModelMultiParts.hpp.
1.5.6