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_TextureCoordinate_HeaderFile 17 #define VrmlData_TextureCoordinate_HeaderFile 18 19 #include <VrmlData_Node.hxx> 20 class gp_XY; 21 22 /** 23 * Implementation of the node TextureCoordinate 24 */ 25 class VrmlData_TextureCoordinate : public VrmlData_Node 26 { 27 public: 28 // ---------- PUBLIC METHODS ---------- 29 30 /** 31 * Empty constructor 32 */ VrmlData_TextureCoordinate()33 inline VrmlData_TextureCoordinate () 34 : myPoints (0L), myLength (0) {} 35 36 /** 37 * Constructor 38 */ VrmlData_TextureCoordinate(const VrmlData_Scene & theScene,const char * theName,const size_t nPoints=0,const gp_XY * arrPoints=0L)39 inline VrmlData_TextureCoordinate (const VrmlData_Scene& theScene, 40 const char * theName, 41 const size_t nPoints = 0, 42 const gp_XY * arrPoints = 0L) 43 : VrmlData_Node (theScene, theName), 44 myPoints (arrPoints), 45 myLength (nPoints) 46 {} 47 48 /** 49 * Create a data array and assign the field myArray. 50 * @return 51 * True if allocation was successful. 52 */ 53 Standard_EXPORT Standard_Boolean 54 AllocateValues (const Standard_Size theLength); 55 56 /** 57 * Query the number of points 58 */ Length()59 inline size_t Length () { return myLength; } 60 61 /** 62 * Query the points 63 */ Points()64 inline const gp_XY * Points () { return myPoints; } 65 66 /** 67 * Set the points array 68 */ SetPoints(const size_t nPoints,const gp_XY * arrPoints)69 inline void SetPoints (const size_t nPoints, 70 const gp_XY * arrPoints) 71 { myPoints = arrPoints; myLength = nPoints; } 72 73 /** 74 * Create a copy of this node. 75 * If the parameter is null, a new copied node is created. Otherwise new node 76 * is not created, but rather the given one is modified. 77 */ 78 Standard_EXPORT virtual Handle(VrmlData_Node) 79 Clone (const Handle(VrmlData_Node)& theOther)const Standard_OVERRIDE; 80 81 /** 82 * Read the Node from input stream. 83 */ 84 Standard_EXPORT virtual VrmlData_ErrorStatus 85 Read (VrmlData_InBuffer& theBuffer) Standard_OVERRIDE; 86 87 private: 88 // ---------- PRIVATE FIELDS ---------- 89 90 const gp_XY * myPoints; 91 size_t myLength; 92 93 public: 94 // Declaration of CASCADE RTTI 95 DEFINE_STANDARD_RTTI_INLINE(VrmlData_TextureCoordinate,VrmlData_Node) 96 }; 97 98 // Definition of HANDLE object using Standard_DefineHandle.hxx 99 DEFINE_STANDARD_HANDLE (VrmlData_TextureCoordinate, VrmlData_Node) 100 101 102 #endif 103