54 #ifndef ACG_ARROWNODE_HH 55 #define ACG_ARROWNODE_HH 60 #include <ACG/Scenegraph/MaterialNode.hh> 61 #include <ACG/GL/globjects.hh> 62 #include <ACG/GL/VertexDeclaration.hh> 84 std::string _name=
"<ArrowNode>" );
97 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax);
100 void reserve(
int _n);
111 int addArrow(
const Vec3f& _start,
const Vec3f& _dir,
const Vec3f& _normal =
Vec3f(0.0f, 1.0f, 0.0f),
const Vec3f& _scale =
Vec3f(1.0f, 1.0f, 1.0f),
const Vec4uc& _color =
Vec4uc(82, 82, 82, 255));
133 int addArrow(
const Vec3d& _start,
const Vec3d& _dir,
const Vec3d& _normal =
Vec3d(0.0, 1.0, 0.0),
const Vec3d& _scale =
Vec3d(1.0, 1.0, 1.0),
const Vec4uc& _color =
Vec4uc(82, 82, 82, 255));
151 Vec3f arrowStart(
int _arrowID)
const;
158 void arrowStart(
int _arrowID,
const Vec3f& _start);
166 Vec3f arrowDir(
int _arrowID)
const;
173 void arrowDir(
int _arrowID,
const Vec3f& _dir);
181 Vec3f arrowNormal(
int _arrowID)
const;
188 void arrowNormal(
int _arrowID,
const Vec3f& _normal);
196 Vec3f arrowScale(
int _arrowID)
const;
204 void arrowScale(
int _arrowID,
const Vec3f& _scale);
211 Vec4uc arrowColor(
int _arrowID)
const;
218 void arrowColor(
int _arrowID,
const Vec4uc& _color);
224 int n_arrows()
const;
240 void createArrowMesh();
243 GLMatrixf computeWorldMatrix(
int _arrow)
const;
244 GLMatrixf readWorldMatrix(
int _arrow)
const;
245 void updateInstanceData();
247 void updateInstanceBuffer();
258 void orthonormalize();
261 std::vector<Arrow> arrows_;
266 GeometryBuffer vertexBuffer_;
267 IndexBuffer indexBuffer_;
269 Vec3f localArrowMin_;
270 Vec3f localArrowMax_;
278 int instanceDataOffset(
int _arrow)
const {
return _arrow * (4*3 + 3*3 +1);}
281 int instanceDataSize()
const {
return 4*3 + 3*3 + 1;}
284 std::vector<float> instanceData_;
287 GeometryBuffer instanceBuffer_;
291 bool invalidateInstanceData_;
292 bool invalidateInstanceBuffer_;
293 int supportsInstancing_;
301 #endif // ACG_ARROWNODE_HH defined Namespace providing different geometric functions concerning angles.
Class to define the vertex input layout.
VectorT< unsigned char, 4 > Vec4uc
VectorT< float, 3 > Vec3f
VectorT< double, 3 > Vec3d