1 // Created on: 2006-05-26 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_Faceted_HeaderFile 17 #define VrmlData_Faceted_HeaderFile 18 19 #include <VrmlData_Geometry.hxx> 20 21 /** 22 * Common API of faceted Geometry nodes: IndexedFaceSet, ElevationGrid, 23 * Extrusion. 24 */ 25 class VrmlData_Faceted : public VrmlData_Geometry 26 { 27 public: 28 // ---------- PUBLIC METHODS ---------- 29 30 /** 31 * Empty constructor 32 */ VrmlData_Faceted()33 inline VrmlData_Faceted () 34 : myCreaseAngle (0.), 35 myIsCCW (Standard_True), 36 myIsSolid (Standard_True), 37 myIsConvex (Standard_True) 38 {} 39 40 /** 41 * Empty constructor 42 */ VrmlData_Faceted(const VrmlData_Scene & theScene,const char * theName,const Standard_Boolean isCCW,const Standard_Boolean isSolid,const Standard_Boolean isConvex,const Standard_Real theCreaseAngle)43 inline VrmlData_Faceted (const VrmlData_Scene& theScene, 44 const char * theName, 45 const Standard_Boolean isCCW, 46 const Standard_Boolean isSolid, 47 const Standard_Boolean isConvex, 48 const Standard_Real theCreaseAngle) 49 : VrmlData_Geometry (theScene, theName), 50 myCreaseAngle (theCreaseAngle), 51 myIsCCW (isCCW), 52 myIsSolid (isSolid), 53 myIsConvex (isConvex) 54 {} 55 56 /** 57 * Query "Is Counter-Clockwise" attribute 58 */ IsCCW() const59 inline Standard_Boolean IsCCW () const { return myIsCCW; } 60 61 /** 62 * Query "Is Solid" attribute 63 */ IsSolid() const64 inline Standard_Boolean IsSolid () const { return myIsSolid; } 65 66 /** 67 * Query "Is Convex" attribute 68 */ IsConvex() const69 inline Standard_Boolean IsConvex () const { return myIsConvex; } 70 71 /** 72 * Query the Crease Angle 73 */ CreaseAngle() const74 inline Standard_Real CreaseAngle () const { return myCreaseAngle; } 75 76 /** 77 * Set "Is Counter-Clockwise" attribute 78 */ SetCCW(const Standard_Boolean theValue)79 inline void SetCCW (const Standard_Boolean theValue) 80 { myIsCCW = theValue; } 81 82 /** 83 * Set "Is Solid" attribute 84 */ SetSolid(const Standard_Boolean theValue)85 inline void SetSolid (const Standard_Boolean theValue) 86 { myIsSolid = theValue; } 87 88 /** 89 * Set "Is Convex" attribute 90 */ SetConvex(const Standard_Boolean theValue)91 inline void SetConvex (const Standard_Boolean theValue) 92 { myIsConvex = theValue; } 93 94 /** 95 * Set "Is Convex" attribute 96 */ SetCreaseAngle(const Standard_Real theValue)97 inline void SetCreaseAngle (const Standard_Real theValue) 98 { myCreaseAngle = theValue; } 99 100 // ---------- PROTECTED METHODS ---------- 101 protected: 102 Standard_EXPORT VrmlData_ErrorStatus 103 readData (VrmlData_InBuffer& theBuffer); 104 105 private: 106 // ---------- PRIVATE FIELDS ---------- 107 108 Standard_Real myCreaseAngle; 109 Standard_Boolean myIsCCW : 1; 110 Standard_Boolean myIsSolid : 1; 111 Standard_Boolean myIsConvex : 1; 112 113 public: 114 // Declaration of CASCADE RTTI 115 DEFINE_STANDARD_RTTI_INLINE(VrmlData_Faceted,VrmlData_Geometry) 116 }; 117 118 // Definition of HANDLE object using Standard_DefineHandle.hxx 119 DEFINE_STANDARD_HANDLE (VrmlData_Faceted, VrmlData_Geometry) 120 121 122 #endif 123