14 VrmlWriter::TNodeMethodMap VrmlWriter::nodeMethodMap;
17 std::ostream&
operator<<(std::ostream& out, VrmlWriter::TIndent& indent)
19 return out << indent.spaces;
33 return out << v[0] <<
" " << v[1] <<
" " << v[2];
39 return out << v[0] <<
" " << v[1] <<
" " << v[2] <<
" " << v[3];
43 template <
class MFValues>
void VrmlWriter::writeMFValues(MFValues values,
int numColumn)
50 int n = values.size();
51 for(
int i=0;
i <
n;
i++){
52 out << values[
i] <<
" ";
63 out << --indent <<
"]\n";
68 void VrmlWriter::writeMFInt32SeparatedByMinusValue(
MFInt32& values)
74 int n = values.size();
75 for(
int i=0;
i <
n;
i++){
76 out << values[
i] <<
" ";
85 out << --indent <<
"]\n";
110 TNodeMethodMap::iterator p =
nodeMethodMap.find(
typeid(*node).name());
120 out <<
"#VRML V2.0 utf8\n";
145 if(node->defName.empty()){
146 out << nodename <<
" {\n";
148 out <<
"DEF " << node->defName <<
" " << nodename <<
" {\n";
172 if(group->bboxSize[0] >= 0){
173 out <<
indent <<
"bboxCenter " << group->bboxCenter <<
"\n";
174 out <<
indent <<
"bboxSize " << group->bboxSize <<
"\n";
177 if(!group->children.empty()){
180 for(
size_t i=0;
i < group->children.size();
i++){
183 out << --indent <<
"]\n";
194 out <<
indent <<
"center " << trans->center <<
"\n";
195 out <<
indent <<
"rotation " << trans->rotation <<
"\n";
196 out <<
indent <<
"scale " << trans->scale <<
"\n";
197 out <<
indent <<
"scaleOrientation " << trans->scaleOrientation <<
"\n";
198 out <<
indent <<
"translation " << trans->translation <<
"\n";
212 if(shape->appearance){
223 (this->*
method)(shape->geometry);
236 if(appearance->material){
251 out <<
indent <<
"ambientIntensity " << material->ambientIntensity <<
"\n";
252 out <<
indent <<
"diffuseColor " << material->diffuseColor <<
"\n";
253 out <<
indent <<
"emissiveColor " << material->emissiveColor <<
"\n";
254 out <<
indent <<
"shininess " << material->shininess <<
"\n";
255 out <<
indent <<
"specularColor " << material->specularColor <<
"\n";
256 out <<
indent <<
"transparency " << material->transparency <<
"\n";
274 if(!faceset->coordIndex.empty()){
281 out <<
indent <<
"creaseAngle " << faceset->creaseAngle <<
"\n";
292 if(!coord->point.empty()){
Matrix33 trans(const Matrix33 &m)
Modifications controlling boost library behavior.
void writeGroupNode(VrmlNodePtr node)
boost::intrusive_ptr< VrmlTransform > VrmlTransformPtr
boost::intrusive_ptr< VrmlGroup > VrmlGroupPtr
void beginNode(const char *nodename, VrmlNodePtr node)
bool writeNode(VrmlNodePtr node)
static TNodeMethodMap nodeMethodMap
VRML IndexedFaseSet node.
void writeNodeIter(VrmlNodePtr node)
boost::intrusive_ptr< VrmlShape > VrmlShapePtr
void writeShapeNode(VrmlNodePtr node)
void writeCoordinateNode(VrmlCoordinatePtr coord)
void writeIndexedFaceSetNode(VrmlNodePtr node)
void(VrmlWriter::* VrmlWriterNodeMethod)(VrmlNodePtr node)
void writeAppearanceNode(VrmlAppearancePtr appearance)
static void registerNodeMethodMap()
boost::intrusive_ptr< VrmlAppearance > VrmlAppearancePtr
const char * boolstr(bool v)
void writeMFInt32SeparatedByMinusValue(MFInt32 &values)
std::ostream & operator<<(std::ostream &out, VrmlWriter::TIndent &indent)
boost::intrusive_ptr< VrmlNode > VrmlNodePtr
void writeMFValues(MFValues values, int numColumn)
std::string indent(int index)
boost::array< SFFloat, 3 > SFVec3f
boost::intrusive_ptr< VrmlIndexedFaceSet > VrmlIndexedFaceSetPtr
static void registNodeMethod(const std::type_info &t, VrmlWriterNodeMethod method)
static VrmlWriterNodeMethod getNodeMethod(VrmlNodePtr node)
boost::intrusive_ptr< VrmlCoordinate > VrmlCoordinatePtr
void writeTransformNode(VrmlNodePtr node)
void writeMaterialNode(VrmlMaterialPtr material)
std::vector< SFInt32 > MFInt32
void writeGroupFields(VrmlGroupPtr group)
boost::array< SFFloat, 4 > SFVec4f
boost::intrusive_ptr< VrmlMaterial > VrmlMaterialPtr