169 super(a,b,c,d,na,nb,nc,nd),
Primitive(
Primitive::
quad,
color),
trySurfaceOptimization(
trySurfaceOptimization),
265 QuadPrimitive(a,b,c,d,
geom_white(),na,nb,nc,nd),
texture(
image,sm),
274 QuadPrimitive(a,b,c,d,
geom_white(),na,nb,nc,nd),
texture(&
image,sm),
323 const int idx =
stride*(x +
w*y);
335 int stride = 1,
bool createFrontOnce=
true,
337 TextureGridPrimitive(
w,
h,front,
px,
py,
pz,
pnx,
pny,
pnz,
stride,createFrontOnce,sm),
back(
back,sm),
355 inline int getIdx(
int x,
int y)
const {
return x+
w*y; }
362 front(frontColor*(1./255)),
back(backColor*(1./255)),
lines(lineColor*(1./255)),
385 int na=-1,
int nb=-1,
int nc=-1,
int nd=-1):
414 const float *xs,
const float *ys,
const float *zs,
int xyzStride,
416 const float *nzs=0,
int nxyzStride=1,
bool createTextureOnce=
true);
421 bool createTextureOnce=
true);
453 const std::string &
text,
456 int na=-1,
int nb=-1,
int nc=-1,
int nd=-1,
virtual Primitive * copy() const
deep copy method
Definition: Primitive.h:208
virtual Primitive * copy() const
must be implemented in order to obtain a deep and independent copy
Definition: Primitive.h:315
Definition: Primitive.h:63
SceneObject * object
the parent object
Definition: Primitive.h:94
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
virtual render method, which is called by the parent scene object
virtual ~Primitive()
virtual, but empty destructor
Definition: Primitive.h:101
bool drawLines
Definition: Primitive.h:353
const icl32f * px
Definition: Primitive.h:301
bool drawQuads
Definition: Primitive.h:353
undocument this line if you encounter any issues!
Definition: Any.h:37
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
render method
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
virtual render method, which is called by the parent scene object
ICLGeom_API void restoreAlphaDefaults()
ICLGeom_API AlphaFuncProperty()
base constructor setting up to GL_GREATER 0.1
const Vec * normals
Definition: Primitive.h:351
math::FixedColVector< int, 8 > super
super type
Definition: Primitive.h:156
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
virtual render method, which is called by the parent scene object
void detach()
ensures that the contained data is not shared by other instances
Definition: Array2D.h:201
Texture Primitive.
Definition: Primitive.h:257
Definition: Primitive.h:69
const std::vector< Vec > & vertices
list of shared vertices
Definition: Primitive.h:86
TrianglePrimitive(int a, int b, int c, const GeomColor &color, int na=-1, int nb=-1, int nc=-1)
constructor
Definition: Primitive.h:135
GeomColor lines
Definition: Primitive.h:352
Special texture Primitive for single textures spread over a regular grid of vertices.
Definition: Primitive.h:296
const core::ImgBase * iback
Definition: Primitive.h:330
#define ICLGeom_API
Definition: CompatMacros.h:179
Definition: Primitive.h:66
SharedTexturePrimitive(int a, int b, int c, int d, int sharedTextureIndex, int na=-1, int nb=-1, int nc=-1, int nd=-1)
create with given texture that is either copied once or everytime the primitive is rendered
Definition: Primitive.h:383
int i(int idx) const
direct access to the i-th vertex/normal index
Definition: Primitive.h:176
const Vec * vertices
Definition: Primitive.h:351
GeomColor textColor
internal memory for the text color
Definition: Primitive.h:441
Definition: Primitive.h:74
int i(int idx) const
direct access to the i-th vertex/normal index
Definition: Primitive.h:142
GeomColor geom_white(float alpha=255)
inline utililty function to create a white color instance
Definition: GeomDefs.h:48
float billboardHeight
used for billboard text
Definition: Primitive.h:449
int getNumPoints() const
direct access to number of vertices
Definition: Primitive.h:215
ICLGeom_API TextPrimitive(int a, int b, int c, int d, const std::string &text, int textSize=20, const GeomColor &textColor=GeomColor(255, 255, 255, 255), int na=-1, int nb=-1, int nc=-1, int nd=-1, float billboardHeight=0, core::scalemode sm=core::interpolateLIN)
constructor
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
virtual render method, which is called by the parent scene object
math::FixedColVector< int, 6 > super
super type
Definition: Primitive.h:132
Abastract base type for geoemtric primitives.
Definition: Primitive.h:59
Definition: Primitive.h:65
Text Texture.
Definition: Primitive.h:436
TwoSidedGridPrimitive(int w, int h, const Vec *vertices, const Vec *normals=0, const GeomColor &frontColor=GeomColor(0, 100, 255, 255), const GeomColor &backColor=GeomColor(255, 0, 100, 255), const GeomColor &lineColor=GeomColor(0, 255, 100, 255), bool drawLines=false, bool drawQuads=true)
Definition: Primitive.h:356
triangle primitive
Definition: Primitive.h:130
ICLGeom_API void setTextures(const core::ImgBase *front, const core::ImgBase *back)
sets new textures
bool lineColorsFromVertices
line coloring
Definition: Primitive.h:90
int alphaFunc
< used for glAlphaFunc call glAlphaFunc((GLenum)alphaFunc,alphaValue)
Definition: Primitive.h:234
utils::SmartPtr< qt::GLImg > texture
Definition: Primitive.h:401
int sharedTextureIndex
Definition: Primitive.h:380
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
render method
Definition: Primitive.h:68
void setAlphaFunc(int func, float value)
used for setting up the alpha func, that is used to render this texture primitive
Definition: Primitive.h:238
Grid primitive that renders a two-sided grid (sides have different colors)
Definition: Primitive.h:348
quad primitive
Definition: Primitive.h:154
utils::Array2D< int > idx
vertex and texture primitives
Definition: Primitive.h:195
const std::vector< Vec > & normals
list of shared normals
Definition: Primitive.h:87
const Vec & getPos(int x, int y) const
Definition: Primitive.h:371
const core::ImgBase * image
< set if the texture shall be updated every time it is drawn
Definition: Primitive.h:259
virtual Primitive * copy() const
deep copy implementation (trivial)
Definition: Primitive.h:179
Primitive(Type type=nothing, const GeomColor &color=GeomColor(255, 255, 255, 255))
Default constructor.
Definition: Primitive.h:98
int stride
Definition: Primitive.h:302
std::vector< int > vertexIndices
if these are given (size > 0), ps and normals are not used!
Definition: Primitive.h:409
int getNormalIndex(int i) const
direct access to i-th normal index
Definition: Primitive.h:222
int h
Definition: Primitive.h:350
virtual Primitive * copy() const
deep copy
Definition: Primitive.h:394
const core::ImgBase * extractImage() const
creates core::ImgBase version of the currently buffered images
qt::GLImg texture
< internal texture
Definition: Primitive.h:258
Ipp32f icl32f
32Bit floating point type for the ICL
Definition: BasicTypes.h:55
void update(const core::ImgBase *src, int maxCellSize=4096)
set new texture data
int w
Definition: Primitive.h:299
Definition: Primitive.h:64
const std::vector< utils::SmartPtr< qt::GLImg > > & sharedTextures
list of shared textures
Definition: Primitive.h:89
void updateText(const std::string &newText)
sets new text
Definition: Primitive.h:472
OpenGL Texture Map Image class.
Definition: GLImg.h:81
int i(int idx) const
direct access to the i-th vertex/normal index
Definition: Primitive.h:123
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
render method
bool quadColorsFromVertices
quad coloring
Definition: Primitive.h:92
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
render
ICLGeom_API void getAABB(utils::Range32f aabb[3])
virtual Primitive * copy() const
deep copy method
Definition: Primitive.h:465
int & operator[](unsigned int idx)
linear data view element access
Definition: FixedMatrix.h:423
bool hasNormals() const
utility method to ask whether normal indices are available
Definition: Primitive.h:225
polygon primitive
Definition: Primitive.h:188
TwoSidedTextureGridPrimitive(int w, int h, const core::ImgBase *front, const core::ImgBase *back, const icl32f *px, const icl32f *py, const icl32f *pz, const icl32f *pnx=0, const icl32f *pny=0, const icl32f *pnz=0, int stride=1, bool createFrontOnce=true, bool createBackOnce=true, core::scalemode sm=core::interpolateLIN)
Definition: Primitive.h:332
int tesselationResolution
number of sub-quads to render for better lighting
Definition: Primitive.h:164
TexturePrimitive(int a, int b, int c, int d, const core::ImgBase *image=0, bool createTextureOnce=true, int na=-1, int nb=-1, int nc=-1, int nd=-1, core::scalemode sm=core::interpolateLIN)
create with given texture that is either copied once or everytime the primitive is rendered
Definition: Primitive.h:262
GeomColor front
Definition: Primitive.h:352
Definition: Primitive.h:328
math::FixedColVector< int, 2 > super
super type
Definition: Primitive.h:113
const core::ImgBase * image
Definition: Primitive.h:303
const icl32f * pnz
Definition: Primitive.h:301
PolygonPrimitive(int n, const int *vidx, const GeomColor &color, const int *nidx=0)
constructor
Definition: Primitive.h:198
Vec4D32f Vec
Short typedef for 4D float vectors.
Definition: GeomDefs.h:87
Definition: Primitive.h:73
std::vector< int > normalIndices
Definition: Primitive.h:410
ICLGeom_API ~TextPrimitive()
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
render method
virtual Primitive * copy() const
deep copy implementation (trivial)
Definition: Primitive.h:126
const icl32f * pny
Definition: Primitive.h:301
int w
Definition: Primitive.h:350
qt::GLImg texture
Definition: Primitive.h:300
scalemode
for scaling of Img images theses functions are provided
Definition: Types.h:84
accumulated context information for rendering primitives
Definition: Primitive.h:85
bool triangleColorsFromVertices
triangle coloring
Definition: Primitive.h:91
float alphaValue
< used for glAlphaFunc call glAlphaFunc((GLenum)alphaFunc,alphaValue)
Definition: Primitive.h:235
Single precission 3D Vectors Point class of the ICL.
Definition: Point32f.h:41
ICLGeom_API Vec computeNormal(const std::vector< Vec > &vertices) const
computes the normal for this triangle
ICLGeom_API GenericTexturePrimitive(const core::ImgBase *image, int numPoints, const float *xs, const float *ys, const float *zs, int xyzStride, const utils::Point32f *texCoords, const float *nxs=0, const float *nys=0, const float *nzs=0, int nxyzStride=1, bool createTextureOnce=true)
Generic version, where the given values are copied deeply into the internal buffers for rendering.
The shared texture primitive references a texture from the parent SceneObject.
Definition: Primitive.h:379
std::vector< Vec > ps
Definition: Primitive.h:404
int getIdx(int x, int y) const
Definition: Primitive.h:355
core::Color4D32f GeomColor
color for geometry primitives
Definition: GeomDefs.h:45
AlphaFuncProperty(int alphaFunc, float alphaValue)
Definition: Primitive.h:232
virtual Primitive * copy() const =0
must be implemented in order to obtain a deep and independent copy
ICLGeom_API Vec computeNormal(const std::vector< Vec > &vertices) const
computes the normal for this quad
int h
Definition: Primitive.h:299
virtual void render(const Primitive::RenderContext &ctx)=0
virtual render method, which is called by the parent scene object
std::vector< Vec > normals
Definition: Primitive.h:406
virtual Primitive * copy() const
must be implemented in order to obtain a deep and independent copy
Definition: Primitive.h:367
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
render method
const core::ImgBase * image
Definition: Primitive.h:402
core::scalemode getScaleMode() const
returns the current scalemode
Type
primitive type for dynamic handling of different primitives
Definition: Primitive.h:62
const icl32f * pnx
Definition: Primitive.h:301
GeomColor back
Definition: Primitive.h:352
static ICLGeom_API core::Img8u create_texture(const std::string &text, const GeomColor &color, int textSize)
utility method to creat a text texture
virtual Primitive * copy() const
deep copy method
Definition: Primitive.h:427
QuadPrimitive(int a, int b, int c, int d, const GeomColor &color, int na=-1, int nb=-1, int nc=-1, int nd=-1, bool trySurfaceOptimization=false, int tesselationResolution=1)
constructor
Definition: Primitive.h:167
int getVertexIndex(int i) const
direct access to i-th vertex index
Definition: Primitive.h:218
line primitive (the line references 2 vertices)
Definition: Primitive.h:111
void copy(const T *src, const T *srcEnd, T *dst)
moves data from source to destination array (no casting possible)
Definition: CoreFunctions.h:216
const std::vector< GeomColor > & vertexColors
list of vertex colors
Definition: Primitive.h:88
virtual Primitive * copy() const
deep copy implementation (trivial)
Definition: Primitive.h:145
LinePrimitive(int a, int b, const GeomColor &color)
constructor
Definition: Primitive.h:116
qt::GLImg back
Definition: Primitive.h:329
Texture Primitive for rendering textures with arbitrary texture coordinates.
Definition: Primitive.h:400
Definition: Primitive.h:72
std::vector< utils::Point32f > texCoords
Definition: Primitive.h:405
Definition: Primitive.h:70
iterator begin()
upper left matrix element iterator
Definition: Array2D.h:180
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
int textSize
internal memory for the text size
Definition: Primitive.h:438
Definition: Primitive.h:67
bool trySurfaceOptimization
visualization optimization flag
Definition: Primitive.h:159
Specialization of the SmartPtrBase class for Pointers.
Definition: SmartPtr.h:75
int getWidth() const
returns the matrix width
Definition: Array2D.h:154
The SceneObject class defines visible objects in scenes or scene graph nodes.
Definition: SceneObject.h:140
Vec getPos(int x, int y) const
Definition: Primitive.h:322
bool polygonColorsFromVertices
polygon coloring
Definition: Primitive.h:93
Definition: Primitive.h:71
const icl32f * pz
Definition: Primitive.h:301
GeomColor color
the color of this primitive
Definition: Primitive.h:78
virtual ICLGeom_API void render(const Primitive::RenderContext &ctx)
render method
virtual Primitive * copy() const
deep copy
Definition: Primitive.h:283
TextureGridPrimitive(int w, int h, const core::ImgBase *image, const icl32f *px, const icl32f *py, const icl32f *pz, const icl32f *pnx=0, const icl32f *pny=0, const icl32f *pnz=0, int stride=1, bool createTextureOnce=true, core::scalemode sm=core::interpolateLIN)
Definition: Primitive.h:306
const icl32f * py
Definition: Primitive.h:301
Type type
the primitive type
Definition: Primitive.h:77
extra base class for primitives, that use a special alpha function (in particular textures)
Definition: Primitive.h:229
int getHeight() const
returns the matrix height
Definition: Array2D.h:157
TexturePrimitive(int a, int b, int c, int d, const core::Img8u &image, int na=-1, int nb=-1, int nc=-1, int nd=-1, core::scalemode sm=core::interpolateLIN)
create with given texture, that is copied once
Definition: Primitive.h:271