0026912: CLang 3.6.2 compiler warning [-Winconsistent-missing-override]
[occt.git] / src / VrmlData / VrmlData_ArrayVec3d.hxx
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_ArrayVec3d_HeaderFile
17 #define VrmlData_ArrayVec3d_HeaderFile
18
19 #include <VrmlData_Node.hxx>
20 class gp_XYZ;
21
22 /**
23  * Implementatioon of basic node for Coordinate, Normal and Color
24  * (array of triplets).
25  */
26 class VrmlData_ArrayVec3d : public VrmlData_Node
27 {
28  public:
29   // ---------- PUBLIC METHODS ----------
30
31   /**
32    * Empty constructor
33    */
34   inline VrmlData_ArrayVec3d ()
35     : myArray (0L), myLength (0)
36   {}
37
38   /**
39    * Constructor
40    */
41   inline VrmlData_ArrayVec3d (const VrmlData_Scene& theScene,
42                               const char            * theName,
43                               const Standard_Size   nVec,
44                               const gp_XYZ          * arrVec)
45     : VrmlData_Node     (theScene, theName),
46       myArray           (arrVec),
47       myLength          (nVec)
48   {}
49
50   /**
51    * Query the number of vectors
52    */
53   inline Standard_Size  Length          () const { return myLength; }
54
55   /**
56    * Query the array
57    */
58   inline const gp_XYZ * Values          () const { return myArray; }
59
60   /**
61    * Create a data array and assign the field myArray.
62    * @return
63    *   True if allocation was successful.
64    */ 
65   Standard_EXPORT Standard_Boolean
66                         AllocateValues  (const Standard_Size theLength);
67
68   /**
69    * Set the array data
70    */
71   inline void           SetValues (const Standard_Size nValues,
72                                    const gp_XYZ * arrValues)
73   { myLength = nValues; myArray = arrValues; }
74
75   /**
76    * Create a copy of this node.
77    * If the parameter is null, a new copied node is created. Otherwise new node
78    * is not created, but rather the given one is modified.
79    */
80 //   Standard_EXPORT virtual Handle(VrmlData_Node)
81 //                         Clone     (const Handle(VrmlData_Node)& theOther)const;
82
83   /**
84    * Read the Node from input stream.
85    */
86   Standard_EXPORT VrmlData_ErrorStatus
87                         ReadArray (VrmlData_InBuffer&     theBuffer,
88                                    const char *           theName,
89                                    const Standard_Boolean isScale);
90
91   /**
92    * Write the Node to the output stream currently opened in Scene.
93    */
94   Standard_EXPORT VrmlData_ErrorStatus
95                         WriteArray(const char *           theName,
96                                    const Standard_Boolean isScale) const;
97
98   /**
99    * Returns True if the node is default, so that it should not be written.
100    */
101   Standard_EXPORT virtual Standard_Boolean
102                         IsDefault () const Standard_OVERRIDE;
103
104  protected:
105   // ---------- PROTECTED METHODS ----------
106   /**
107    * Query one vector
108    * @param i
109    *   index in the array of vectors [0 .. N-1]
110    * @return
111    *   the vector for the index. If index irrelevant, returns (0., 0., 0.)
112    */
113   Standard_EXPORT const gp_XYZ& Value (const Standard_Size i) const;
114
115  protected:
116   // ---------- PROTECTED FIELDS ----------
117
118   const gp_XYZ  * myArray;
119   Standard_Size   myLength;
120
121  public:
122 // Declaration of CASCADE RTTI
123 DEFINE_STANDARD_RTTI (VrmlData_ArrayVec3d, VrmlData_Node)
124 };
125
126 // Definition of HANDLE object using Standard_DefineHandle.hxx
127 DEFINE_STANDARD_HANDLE (VrmlData_ArrayVec3d, VrmlData_Node)
128
129
130 #endif