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_Coordinate_HeaderFile |
23 | #define VrmlData_Coordinate_HeaderFile |
24 | |
25 | #include <VrmlData_ArrayVec3d.hxx> |
26 | |
27 | /** |
28 | * Implementation of the node Coordinate |
29 | */ |
30 | class VrmlData_Coordinate : public VrmlData_ArrayVec3d |
31 | { |
32 | public: |
33 | // ---------- PUBLIC METHODS ---------- |
34 | |
35 | /** |
36 | * Empty Constructor |
37 | */ |
38 | inline VrmlData_Coordinate () {} |
39 | |
40 | /** |
41 | * Constructor |
42 | */ |
43 | inline VrmlData_Coordinate (const VrmlData_Scene& theScene, |
44 | const char * theName, |
45 | const size_t nPoints = 0, |
46 | const gp_XYZ * arrPoints = 0L) |
47 | : VrmlData_ArrayVec3d (theScene, theName, nPoints, arrPoints) |
48 | {} |
49 | |
50 | /** |
51 | * Query one point |
52 | * @param i |
53 | * index in the array of points [0 .. N-1] |
54 | * @return |
55 | * the coordinate for the index. If index irrelevant, returns (0., 0., 0.) |
56 | */ |
57 | inline const gp_XYZ& Coordinate (const Standard_Integer i) const |
58 | { return Value(i); } |
59 | |
60 | /** |
61 | * Create a copy of this node. |
62 | * If the parameter is null, a new copied node is created. Otherwise new node |
63 | * is not created, but rather the given one is modified. |
64 | */ |
65 | Standard_EXPORT virtual Handle(VrmlData_Node) |
66 | Clone (const Handle(VrmlData_Node)& theOther)const; |
67 | |
68 | /** |
69 | * Read the Node from input stream. |
70 | */ |
71 | Standard_EXPORT virtual VrmlData_ErrorStatus |
72 | Read (VrmlData_InBuffer& theBuffer); |
73 | |
74 | /** |
75 | * Write the Node to the Scene output. |
76 | */ |
77 | Standard_EXPORT virtual VrmlData_ErrorStatus |
78 | Write (const char * thePrefix) const; |
79 | |
80 | private: |
81 | // ---------- PRIVATE FIELDS ---------- |
82 | |
83 | public: |
84 | // Declaration of CASCADE RTTI |
85 | DEFINE_STANDARD_RTTI (VrmlData_Coordinate) |
86 | }; |
87 | |
88 | // Definition of HANDLE object using Standard_DefineHandle.hxx |
89 | DEFINE_STANDARD_HANDLE (VrmlData_Coordinate, VrmlData_ArrayVec3d) |
90 | |
91 | |
92 | #endif |