namespace X3DTK { namespace X3D { template MyMeshBuilderRenderingVisitor::MyMeshBuilderRenderingVisitor() : TemplateMeshBuilderRenderingVisitor() { define(Recorder::getEnterFunction(&MyMeshBuilderRenderingVisitor::enterMyCoordinate)); } template void MyMeshBuilderRenderingVisitor::enterMyCoordinate(MyCoordinate *C) { TemplateMeshBuilderStateVariables *stateVariables = Singleton >::getInstance(); MESH::TemplateVertex *MC = dynamic_cast *>(stateVariables->getNode(C)); if (MC != 0) { // Filling the Vertices. const MFFloat &weight = C->getWeight(); const typename MESH::TemplateVertex::MFVertex &vertices = MC->getVertices(); // Test the optional presence of MESH::VertexPointData in VData. #ifdef TEMPLATE_SPECIALIZATION_SUPPORTED if (VData::template find() && weight.size() >= vertices.size()) #endif { MFFloat::const_iterator w = weight.begin(); // Accessing the MESH::VertexWeightData of VData. for (typename MESH::TemplateVertex::MFVertex::const_iterator v = vertices.begin(); v != vertices.end(); ++v) { #ifdef TEMPLATE_SPECIALIZATION_SUPPORTED (*v)->template ogetData().setWeight(*w); #else (*v)->data().setWeight(*w); #endif ++w; } } stateVariables->addCoupleNode(C, MC); } stateVariables->pushNode(MC); } } }