55 #ifndef ACG_SPLATCLOUDNODE_HH 56 #define ACG_SPLATCLOUDNODE_HH 62 #include "SplatCloud/SplatCloud.hh" 66 #include <ACG/Scenegraph/BaseNode.hh> 68 #include <ACG/Scenegraph/DrawModes.hh> 70 #include <ACG/GL/gl.hh> 72 #include <ACG/GL/VertexDeclaration.hh> 98 typedef SplatCloud::Pointsize Pointsize;
99 typedef SplatCloud::Index Index;
100 typedef SplatCloud::Viewlist Viewlist;
101 typedef SplatCloud::Selection Selection;
135 inline const SplatCloud &splatCloud()
const {
return splatCloud_; }
139 inline void modifiedPositions() { positionsModified_ =
true; }
140 inline void modifiedColors() { colorsModified_ =
true; }
141 inline void modifiedNormals() { normalsModified_ =
true; }
142 inline void modifiedPointsizes() { pointsizesModified_ =
true; }
143 inline void modifiedSelections() { selectionsModified_ =
true; }
144 inline void modifiedPickColors() { pickColorsModified_ =
true; }
146 inline void modifiedAll()
151 modifiedPointsizes();
152 modifiedSelections();
153 modifiedPickColors();
158 inline void setDefaultColor (
const Color &_color ) { defaultColor_ = _color; }
159 inline void setDefaultNormal (
const Normal &_normal ) { defaultNormal_ = _normal; }
160 inline void setDefaultPointsize(
const Pointsize &_pointsize ) { defaultPointsize_ = _pointsize; }
162 inline const Color &defaultColor()
const {
return defaultColor_; }
163 inline const Normal &defaultNormal()
const {
return defaultNormal_; }
164 inline const Pointsize &defaultPointsize()
const {
return defaultPointsize_; }
167 inline const Position &
getPosition (
int _idx )
const {
return splatCloud_.hasPositions() ? splatCloud_.positions ( _idx ) : DEFAULT_POSITION; }
168 inline const Color &getColor (
int _idx )
const {
return splatCloud_.hasColors() ? splatCloud_.colors ( _idx ) : defaultColor_; }
169 inline const Normal &getNormal (
int _idx )
const {
return splatCloud_.hasNormals() ? splatCloud_.normals ( _idx ) : defaultNormal_; }
170 inline const Pointsize &getPointsize(
int _idx )
const {
return splatCloud_.hasPointsizes() ? splatCloud_.pointsizes( _idx ) : defaultPointsize_; }
171 inline const Index &getIndex (
int _idx )
const {
return splatCloud_.hasIndices() ? splatCloud_.indices ( _idx ) : DEFAULT_INDEX; }
172 inline const Viewlist &getViewlist (
int _idx )
const {
return splatCloud_.hasViewlists() ? splatCloud_.viewlists ( _idx ) : DEFAULT_VIEWLIST; }
173 inline const Selection &getSelection(
int _idx )
const {
return splatCloud_.hasSelections() ? splatCloud_.selections( _idx ) : DEFAULT_SELECTION; }
178 inline void setPointsizeScale(
float _scale) { pointsizeScale_ = _scale; }
179 inline void setBackfaceCulling(
bool _enable) { backfaceCulling_ = _enable; }
180 inline void setGeometryShaderQuads(
bool _enable) { geometryShaderQuads_ = _enable; }
182 inline float getPointsizeScale()
const {
return pointsizeScale_; }
183 inline bool getBackfaceCulling()
const {
return backfaceCulling_; }
184 inline bool getGeometryShaderQuads()
const {
return geometryShaderQuads_; }
200 bool colorsModified_;
201 bool normalsModified_;
202 bool pointsizesModified_;
203 bool selectionsModified_;
204 bool pickColorsModified_;
209 return positionsModified_ ||
212 pointsizesModified_ ||
213 selectionsModified_ ||
221 Normal defaultNormal_;
222 Pointsize defaultPointsize_;
232 unsigned int pickingBaseIndex_;
240 unsigned int vboNumSplats_;
241 unsigned char *vboData_;
242 unsigned int vboStride_;
246 int vboColorsOffset_;
247 int vboNormalsOffset_;
248 int vboPointsizesOffset_;
249 int vboSelectionsOffset_;
250 int vboPickColorsOffset_;
257 return vboNumSplats_ != splatCloud_.
numSplats() ||
258 (vboPositionsOffset_ != -1) != splatCloud_.
hasPositions() ||
259 (vboColorsOffset_ != -1) != splatCloud_.
hasColors() ||
260 (vboNormalsOffset_ != -1) != splatCloud_.
hasNormals() ||
261 (vboPointsizesOffset_ != -1) != splatCloud_.
hasPointsizes() ||
267 void rebuildVBO(
GLState &_state );
269 void rebuildVBOPositions();
270 void rebuildVBOColors();
271 void rebuildVBONormals();
272 void rebuildVBOPointsizes();
273 void rebuildVBOSelections();
274 void rebuildVBOPickColors(
GLState &_state );
276 static const Position DEFAULT_POSITION;
277 static const Index DEFAULT_INDEX;
278 static const Viewlist DEFAULT_VIEWLIST;
279 static const Selection DEFAULT_SELECTION;
283 float pointsizeScale_;
284 bool backfaceCulling_;
285 bool geometryShaderQuads_;
299 #endif // ACG_SPLATCLOUDNODE_HH bool vboModified() const
return true iff any of the data values in the VBO has to be changed
Namespace providing different geometric functions concerning angles.
Class to define the vertex input layout.
bool hasNormals() const
Return the availability of the predefined property.
bool vboStructureModified() const
returns true iff the internal block structure of the VBO has to be changed
bool hasColors() const
Return the availability of the predefined property.
int vboPositionsOffset_
offsets relative to vboData_ or -1 if not present in VBO
bool hasPositions() const
Return the availability of the predefined property.
Add colors to mesh item (vertices/faces/edges)
bool positionsModified_
marks if parts of the data has been modified
ACG::SceneGraph::SplatCloudNode SplatCloudNode
Simple Name for SplatCloudNode.
Color defaultColor_
the default values will be used when the specific array is not present
unsigned int numSplats() const
Get the number of splats.
bool hasSelections() const
Return the availability of the predefined property.
PickTarget
What target to use for picking.
const SplatCloud & splatCloud_
reference to class containing all the data
bool hasPointsizes() 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 ...
DrawModes::DrawMode availableDrawModes() const
return available draw modes