]> OCCT Git - occt.git/commitdiff
Coding, GLTF - Isolate RapidJSon part #192
authordpasukhi <dpasukhi@opencascade.com>
Sat, 14 Dec 2024 12:21:50 +0000 (12:21 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Sat, 14 Dec 2024 13:06:32 +0000 (13:06 +0000)
Regression after #184 where some methods are not isolated.

src/RWGltf/RWGltf_GltfJsonParser.cxx
src/RWGltf/RWGltf_GltfJsonParser.hxx

index e69e2f0a034ed362e052584c8797949b3c3651ec..c3fc588c5fef94f20595150f262454ae31a1ddb3 100644 (file)
 #ifdef HAVE_RAPIDJSON
 namespace
 {
+// Auxiliary macros for formatting message.
+#define reportGltfError(theMsg)   reportGltfSyntaxProblem(TCollection_AsciiString() + theMsg, Message_Fail);
+#define reportGltfWarning(theMsg) reportGltfSyntaxProblem(TCollection_AsciiString() + theMsg, Message_Warning);
+
   //! Material extension.
   static const char THE_KHR_materials_common[] = "KHR_materials_common";
   static const char THE_KHR_binary_glTF[]      = "KHR_binary_glTF";
@@ -416,21 +420,6 @@ void RWGltf_GltfJsonParser::GltfElementMap::Init (const TCollection_AsciiString&
     }
   }
 }
-#endif
-
-// Auxiliary macros for formatting message.
-#define reportGltfError(theMsg)   reportGltfSyntaxProblem(TCollection_AsciiString() + theMsg, Message_Fail);
-#define reportGltfWarning(theMsg) reportGltfSyntaxProblem(TCollection_AsciiString() + theMsg, Message_Warning);
-
-// =======================================================================
-// function : reportGltfSyntaxProblem
-// purpose  :
-// =======================================================================
-void RWGltf_GltfJsonParser::reportGltfSyntaxProblem (const TCollection_AsciiString& theMsg,
-                                                    Message_Gravity theGravity) const
-{
-  Message::Send (myErrorPrefix + theMsg, theGravity);
-}
 
 // =======================================================================
 // function : parseTransformationMatrix
@@ -595,6 +584,17 @@ bool RWGltf_GltfJsonParser::parseTransformationComponents(const TCollection_Asci
   }
   return true;
 }
+#endif
+
+// =======================================================================
+// function : reportGltfSyntaxProblem
+// purpose  :
+// =======================================================================
+void RWGltf_GltfJsonParser::reportGltfSyntaxProblem (const TCollection_AsciiString& theMsg,
+                                                    Message_Gravity theGravity) const
+{
+  Message::Send (myErrorPrefix + theMsg, theGravity);
+}
 
 // =======================================================================
 // function : RWGltf_GltfJsonParser
index 19748ad5ed377b0f841f9b851a0eaf28b599a64f..ccb5757a19e75a04e74457bf79edbf04219ae5c5 100644 (file)
@@ -406,10 +406,6 @@ protected:
     const RWGltf_JsonValue* myRoot;
 
   };
-#endif
-protected:
-  //! Print message about invalid glTF syntax.
-  void reportGltfSyntaxProblem (const TCollection_AsciiString& theMsg, Message_Gravity theGravity) const;
 
 private:
   //! Parse transformation matrix of the node.
@@ -438,6 +434,10 @@ private:
                                      const RWGltf_JsonValue* theScaleVal,
                                      const RWGltf_JsonValue* theTranslationVal,
                                      TopLoc_Location& theResult) const;
+#endif
+protected:
+  //! Print message about invalid glTF syntax.
+  void reportGltfSyntaxProblem (const TCollection_AsciiString& theMsg, Message_Gravity theGravity) const;
 
 protected:
   TopTools_SequenceOfShape*        myRootShapes;    //!< sequence of result root shapes