theBuffer.Input.getline (theBuffer.Line, sizeof(theBuffer.Line));
theBuffer.LineCount++;
const int stat = theBuffer.Input.rdstate();
- if (stat & ios::badbit)
+ if (stat & ios::badbit) {
aStatus = VrmlData_UnrecoverableError;
- else if (stat & ios::failbit)
- if (stat & ios::eofbit)
+ }
+ else if (stat & ios::failbit) {
+ if (stat & ios::eofbit) {
aStatus = VrmlData_EndOfFile;
- else
+ }
+ else {
aStatus = VrmlData_GeneralError;
+ }
+ }
theBuffer.LinePtr = &theBuffer.Line[0];
theBuffer.IsProcessed = Standard_False;
}
TCollection_AsciiString aName;
// Read the DEF token to assign the node name
- if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer)))
+ if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) {
if (VRMLDATA_LCOMPARE(theBuffer.LinePtr, "DEF")) {
if (VrmlData_Node::OK(aStatus, ReadWord (theBuffer, aName)))
aStatus = ReadLine(theBuffer);
theNode.Nullify();
return aStatus;
}
+ }
const char * strName = aName.ToCString();
if (aStatus == VrmlData_StatusOK) {
aStatus = ReadWord (theBuffer, aTitle);
if (isProto) {
aStatus = ReadLine(theBuffer);
- if (aStatus == VrmlData_StatusOK)
+ if (aStatus == VrmlData_StatusOK) {
if (theBuffer.LinePtr[0] != '[')
aStatus = VrmlData_VrmlFormatError;
else {
}
}
}
+ }
}
if (aStatus == VrmlData_StatusOK)
aNode = new VrmlData_UnknownNode(* this,
}
aStatus = ReadLine(theBuffer);
if (aNode.IsNull() == Standard_False) {
- if (aNode->Name()[0] != '\0')
+ if (aNode->Name()[0] != '\0')
myNamedNodes.Add (aNode);
if (theType.IsNull() == Standard_False)
if (aNode->IsKind(theType) == Standard_False)
aStatus = VrmlData_VrmlFormatError;
}
- if (aStatus == VrmlData_StatusOK)
+ if (aStatus == VrmlData_StatusOK) {
if (theBuffer.LinePtr[0] == '{') {
theBuffer.LinePtr++;
theNode = aNode;
myAllNodes.Append(aNode);
- } else
+ } else {
aStatus = VrmlData_VrmlFormatError;
+ }
+ }
return aStatus;
}
theBuffer.LinePtr = endptr;
}
}
- if (aStatus == VrmlData_StatusOK)
- if (isScale)
+ if (aStatus == VrmlData_StatusOK) {
+ if (isScale) {
theXYZ.SetCoord (aVal[0] * myLinearScale,
aVal[1] * myLinearScale,
aVal[2] * myLinearScale);
- else
+ }
+ else {
theXYZ.SetCoord (aVal[0], aVal[1], aVal[2]);
+ }
+ }
return aStatus;
}
theBuffer.LinePtr = endptr;
}
}
- if (aStatus == VrmlData_StatusOK)
+ if (aStatus == VrmlData_StatusOK) {
if (isScale)
theXY.SetCoord (aVal[0] * myLinearScale, aVal[1] * myLinearScale);
else
theXY.SetCoord (aVal[0], aVal[1]);
+ }
return aStatus;
}
{
VrmlData_ErrorStatus aStatus;
theNBlocks = 0;
- if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer)))
+ if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) {
if (theBuffer.LinePtr[0] != '[') // opening bracket
aStatus = VrmlData_VrmlFormatError;
else {
}
}
}
+ }
return aStatus;
}
const char * thePostfix) const
{
char buf[240];
- if (IsDummyWrite() == Standard_False)
+ if (IsDummyWrite() == Standard_False) {
if (isApplyScale && myLinearScale > Precision::Confusion())
Sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X() / myLinearScale,
theXYZ.Y() / myLinearScale, theXYZ.Z() / myLinearScale,
else
Sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X(), theXYZ.Y(), theXYZ.Z(),
thePostfix ? thePostfix : "");
+ }
return WriteLine (buf);
}