1 // Created on: 2006-05-25 2 // Created by: Alexander GRIGORIEV 3 // Copyright (c) 2006-2014 OPEN CASCADE SAS 4 // 5 // This file is part of Open CASCADE Technology software library. 6 // 7 // This library is free software; you can redistribute it and/or modify it under 8 // the terms of the GNU Lesser General Public License version 2.1 as published 9 // by the Free Software Foundation, with special exception defined in the file 10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 11 // distribution for complete text of the license and disclaimer of any warranty. 12 // 13 // Alternatively, this file may be used under the terms of Open CASCADE 14 // commercial license or contractual agreement. 15 16 #ifndef VrmlData_ShapeNode_HeaderFile 17 #define VrmlData_ShapeNode_HeaderFile 18 19 #include <VrmlData_Appearance.hxx> 20 #include <VrmlData_Geometry.hxx> 21 22 /** 23 * Implementation of the Shape node type 24 */ 25 class VrmlData_ShapeNode : public VrmlData_Node 26 { 27 public: 28 // ---------- PUBLIC METHODS ---------- 29 30 /** 31 * Empty constructor 32 */ VrmlData_ShapeNode()33 inline VrmlData_ShapeNode () {} 34 35 /** 36 * Constructor 37 */ VrmlData_ShapeNode(const VrmlData_Scene & theScene,const char * theName)38 inline VrmlData_ShapeNode (const VrmlData_Scene& theScene, 39 const char * theName) 40 : VrmlData_Node (theScene, theName) {} 41 42 /** 43 * Query the Appearance. 44 */ Handle(VrmlData_Appearance)45 inline const Handle(VrmlData_Appearance)& 46 Appearance () const { return myAppearance; } 47 48 /** 49 * Query the Geometry. 50 */ Handle(VrmlData_Geometry)51 inline const Handle(VrmlData_Geometry)& 52 Geometry () const { return myGeometry; } 53 54 /** 55 * Set the Appearance 56 */ SetAppearance(const Handle (VrmlData_Appearance)& theAppear)57 inline void SetAppearance (const Handle(VrmlData_Appearance)& theAppear) 58 { myAppearance = theAppear; } 59 60 /** 61 * Set the Geometry 62 */ SetGeometry(const Handle (VrmlData_Geometry)& theGeometry)63 inline void SetGeometry (const Handle(VrmlData_Geometry)& theGeometry) 64 { myGeometry = theGeometry; } 65 66 /** 67 * Create a copy of this node. 68 * If the parameter is null, a new copied node is created. Otherwise new node 69 * is not created, but rather the given one is modified. 70 */ 71 Standard_EXPORT virtual Handle(VrmlData_Node) 72 Clone (const Handle(VrmlData_Node)& theOther)const Standard_OVERRIDE; 73 74 /** 75 * Fill the Node internal data from the given input stream. 76 */ 77 Standard_EXPORT virtual VrmlData_ErrorStatus 78 Read (VrmlData_InBuffer& theBuffer) Standard_OVERRIDE; 79 80 /** 81 * Write the Node to output stream. 82 */ 83 Standard_EXPORT virtual VrmlData_ErrorStatus 84 Write (const char * thePrefix) const Standard_OVERRIDE; 85 86 /** 87 * Check if the Shape Node is writeable. 88 */ 89 Standard_EXPORT virtual Standard_Boolean 90 IsDefault () const Standard_OVERRIDE; 91 92 protected: 93 // ---------- PROTECTED METHODS ---------- 94 95 96 97 private: 98 // ---------- PRIVATE FIELDS ---------- 99 100 Handle(VrmlData_Appearance) myAppearance; 101 Handle(VrmlData_Geometry) myGeometry; 102 103 public: 104 // Declaration of CASCADE RTTI 105 DEFINE_STANDARD_RTTI_INLINE(VrmlData_ShapeNode,VrmlData_Node) 106 }; 107 108 // Definition of HANDLE object using Standard_DefineHandle.hxx 109 DEFINE_STANDARD_HANDLE (VrmlData_ShapeNode, VrmlData_Node) 110 111 112 #endif 113