b311480e |
1 | // Created on: 2006-05-26 |
2 | // Created by: Alexander GRIGORIEV |
3 | // Copyright (c) 2006-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
9 | // |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | // |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | |
21 | |
22 | #ifndef VrmlData_TextureCoordinate_HeaderFile |
23 | #define VrmlData_TextureCoordinate_HeaderFile |
24 | |
25 | #include <VrmlData_Node.hxx> |
26 | class gp_XY; |
27 | |
28 | /** |
29 | * Implementation of the node TextureCoordinate |
30 | */ |
31 | class VrmlData_TextureCoordinate : public VrmlData_Node |
32 | { |
33 | public: |
34 | // ---------- PUBLIC METHODS ---------- |
35 | |
36 | /** |
37 | * Empty constructor |
38 | */ |
39 | inline VrmlData_TextureCoordinate () |
40 | : myPoints (0L), myLength (0) {} |
41 | |
42 | /** |
43 | * Constructor |
44 | */ |
45 | inline VrmlData_TextureCoordinate (const VrmlData_Scene& theScene, |
46 | const char * theName, |
47 | const size_t nPoints = 0, |
48 | const gp_XY * arrPoints = 0L) |
49 | : VrmlData_Node (theScene, theName), |
50 | myPoints (arrPoints), |
51 | myLength (nPoints) |
52 | {} |
53 | |
54 | /** |
55 | * Create a data array and assign the field myArray. |
56 | * @return |
57 | * True if allocation was successful. |
58 | */ |
59 | Standard_EXPORT Standard_Boolean |
60 | AllocateValues (const Standard_Size theLength); |
61 | |
62 | /** |
63 | * Query the number of points |
64 | */ |
65 | inline size_t Length () { return myLength; } |
66 | |
67 | /** |
68 | * Query the points |
69 | */ |
70 | inline const gp_XY * Points () { return myPoints; } |
71 | |
72 | /** |
73 | * Set the points array |
74 | */ |
75 | inline void SetPoints (const size_t nPoints, |
76 | const gp_XY * arrPoints) |
77 | { myPoints = arrPoints; myLength = nPoints; } |
78 | |
79 | /** |
80 | * Create a copy of this node. |
81 | * If the parameter is null, a new copied node is created. Otherwise new node |
82 | * is not created, but rather the given one is modified. |
83 | */ |
84 | Standard_EXPORT virtual Handle(VrmlData_Node) |
85 | Clone (const Handle(VrmlData_Node)& theOther)const; |
86 | |
87 | /** |
88 | * Read the Node from input stream. |
89 | */ |
90 | Standard_EXPORT virtual VrmlData_ErrorStatus |
91 | Read (VrmlData_InBuffer& theBuffer); |
92 | |
93 | private: |
94 | // ---------- PRIVATE FIELDS ---------- |
95 | |
96 | const gp_XY * myPoints; |
97 | size_t myLength; |
98 | |
99 | public: |
100 | // Declaration of CASCADE RTTI |
101 | DEFINE_STANDARD_RTTI (VrmlData_TextureCoordinate) |
102 | }; |
103 | |
104 | // Definition of HANDLE object using Standard_DefineHandle.hxx |
105 | DEFINE_STANDARD_HANDLE (VrmlData_TextureCoordinate, VrmlData_Node) |
106 | |
107 | |
108 | #endif |