61 #ifndef ACG_SPLATCLOUDNODE_HH 62 #define ACG_SPLATCLOUDNODE_HH 68 #include "SplatCloud/SplatCloud.hh" 72 #include <ACG/Scenegraph/BaseNode.hh> 74 #include <ACG/Scenegraph/DrawModes.hh> 76 #include <ACG/GL/gl.hh> 103 typedef SplatCloud::Pointsize Pointsize;
104 typedef SplatCloud::Index Index;
105 typedef SplatCloud::Viewlist Viewlist;
106 typedef SplatCloud::Selection Selection;
137 inline const SplatCloud &splatCloud()
const {
return splatCloud_; }
141 inline void modifiedPositions() { positionsModified_ =
true; }
142 inline void modifiedColors() { colorsModified_ =
true; }
143 inline void modifiedNormals() { normalsModified_ =
true; }
144 inline void modifiedPointsizes() { pointsizesModified_ =
true; }
145 inline void modifiedSelections() { selectionsModified_ =
true; }
146 inline void modifiedPickColors() { pickColorsModified_ =
true; }
148 inline void modifiedAll()
153 modifiedPointsizes();
154 modifiedSelections();
155 modifiedPickColors();
160 inline void setDefaultColor (
const Color &_color ) { defaultColor_ = _color; }
161 inline void setDefaultNormal (
const Normal &_normal ) { defaultNormal_ = _normal; }
162 inline void setDefaultPointsize(
const Pointsize &_pointsize ) { defaultPointsize_ = _pointsize; }
164 inline const Color &defaultColor()
const {
return defaultColor_; }
165 inline const Normal &defaultNormal()
const {
return defaultNormal_; }
166 inline const Pointsize &defaultPointsize()
const {
return defaultPointsize_; }
169 inline const Position &
getPosition (
int _idx )
const {
return splatCloud_.hasPositions() ? splatCloud_.positions ( _idx ) : DEFAULT_POSITION; }
170 inline const Color &getColor (
int _idx )
const {
return splatCloud_.hasColors() ? splatCloud_.colors ( _idx ) : defaultColor_; }
171 inline const Normal &getNormal (
int _idx )
const {
return splatCloud_.hasNormals() ? splatCloud_.normals ( _idx ) : defaultNormal_; }
172 inline const Pointsize &getPointsize(
int _idx )
const {
return splatCloud_.hasPointsizes() ? splatCloud_.pointsizes( _idx ) : defaultPointsize_; }
173 inline const Index &getIndex (
int _idx )
const {
return splatCloud_.hasIndices() ? splatCloud_.indices ( _idx ) : DEFAULT_INDEX; }
174 inline const Viewlist &getViewlist (
int _idx )
const {
return splatCloud_.hasViewlists() ? splatCloud_.viewlists ( _idx ) : DEFAULT_VIEWLIST; }
175 inline const Selection &getSelection(
int _idx )
const {
return splatCloud_.hasSelections() ? splatCloud_.selections( _idx ) : DEFAULT_SELECTION; }
190 bool colorsModified_;
191 bool normalsModified_;
192 bool pointsizesModified_;
193 bool selectionsModified_;
194 bool pickColorsModified_;
199 return positionsModified_ ||
202 pointsizesModified_ ||
203 selectionsModified_ ||
211 Normal defaultNormal_;
212 Pointsize defaultPointsize_;
222 unsigned int pickingBaseIndex_;
230 unsigned int vboNumSplats_;
231 unsigned char *vboData_;
235 int vboColorsOffset_;
236 int vboNormalsOffset_;
237 int vboPointsizesOffset_;
238 int vboSelectionsOffset_;
239 int vboPickColorsOffset_;
244 return vboNumSplats_ != splatCloud_.
numSplats() ||
245 (vboPositionsOffset_ != -1) != splatCloud_.
hasPositions() ||
246 (vboColorsOffset_ != -1) != splatCloud_.
hasColors() ||
247 (vboNormalsOffset_ != -1) != splatCloud_.
hasNormals() ||
248 (vboPointsizesOffset_ != -1) != splatCloud_.
hasPointsizes() ||
254 void rebuildVBO(
GLState &_state );
256 void rebuildVBOPositions();
257 void rebuildVBOColors();
258 void rebuildVBONormals();
259 void rebuildVBOPointsizes();
260 void rebuildVBOSelections();
261 void rebuildVBOPickColors(
GLState &_state );
263 static const Position DEFAULT_POSITION;
264 static const Index DEFAULT_INDEX;
265 static const Viewlist DEFAULT_VIEWLIST;
266 static const Selection DEFAULT_SELECTION;
280 #endif // ACG_SPLATCLOUDNODE_HH
bool hasSelections() const
Return the availability of the predefined property.
bool hasPointsizes() const
Return the availability of the predefined property.
bool hasColors() const
Return the availability of the predefined property.
Add normals to mesh item (vertices/faces)
DrawModes::DrawMode availableDrawModes() const
return available draw modes
bool vboStructureModified() const
returns true iff the internal block structure of the VBO has to be changed
ACG::SceneGraph::SplatCloudNode SplatCloudNode
Simple Name for SplatCloudNode.
int vboPositionsOffset_
offsets relative to vboData_ or -1 if not present in VBO
bool positionsModified_
marks if parts of the data has been modified
PickTarget
What target to use for picking.
unsigned int numSplats() const
Get the number of splats.
Add colors to mesh item (vertices/faces/edges)
Namespace providing different geometric functions concerning angles.
const SplatCloud & splatCloud_
reference to class containing all the data
bool hasNormals() const
Return the availability of the predefined property.
bool vboModified() const
return true iff any of the data values in the VBO has to be changed
bool hasPositions() const
Return the availability of the predefined property.
const Position & getPosition(int _idx) const
if the data array exists, the entry with the given index is returned, otherwise the default value is ...
Color defaultColor_
the default values will be used when the specific array is not present