Image Component Library (ICL)
Primitive.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLGeom/src/ICLGeom/Primitive.h **
10 ** Module : ICLGeom **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLGeom/GeomDefs.h>
35 #include <ICLCore/Img.h>
36 #include <ICLMath/FixedVector.h>
37 #include <ICLUtils/Array2D.h>
38 #include <ICLQt/GLImg.h>
39 
40 namespace icl{
41  namespace geom{
43  class SceneObject;
46 
59  struct Primitive{
60 
62  enum Type{
63  vertex = 1<<0, //<! vertex
64  line = 1<<1, //<! line primitive (adressing two vertices -> start and end position of the line)
65  triangle = 1<<2, //<! triange primitive (adressing three vertices)
66  quad = 1<<3, //<! quad primitve (adressing four vertices)
67  polygon = 1<<4, //<! polygon primitive (adressing at least 3 vertices)
68  texture = 1<<5, //<! texture primitive (using 4 vertices like a quad as textured rectangle)
69  text = 1<<6, //<! text primitive (internally implmented as texture or as billboard)
70  nothing = 1<<7, //<! internally used type
71  custom = 1<<20, //<! for custom primitives
72  PRIMITIVE_TYPE_COUNT = 8, //<! also for internal use only
73  all = (1<<PRIMITIVE_TYPE_COUNT)-1, //<! all types
75  };
76 
79 
81 
85  struct RenderContext{
86  const std::vector<Vec> &vertices;
87  const std::vector<Vec> &normals;
88  const std::vector<GeomColor> &vertexColors;
89  const std::vector<utils::SmartPtr<qt::GLImg> > &sharedTextures;
95  };
96 
99 
101  virtual ~Primitive() {}
102 
104  virtual void render(const Primitive::RenderContext &ctx) = 0;
105 
107  virtual Primitive *copy() const = 0;
108  };
109 
111  struct LinePrimitive : public math::FixedColVector<int,2>, public Primitive{
114 
116  LinePrimitive(int a, int b, const GeomColor &color):
117  math::FixedColVector<int,2>(a,b),Primitive(Primitive::line,color){}
118 
120  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
121 
123  inline int i(int idx) const { return super::operator[](idx); }
124 
126  virtual Primitive *copy() const { return new LinePrimitive(*this); }
127  };
128 
130  struct TrianglePrimitive : public math::FixedColVector<int,6>, public Primitive{
133 
135  TrianglePrimitive(int a, int b, int c, const GeomColor &color, int na=-1, int nb=-1, int nc=-1):
136  super(a,b,c,na,nb,nc),Primitive(Primitive::triangle,color){}
137 
139  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
140 
142  inline int i(int idx) const { return super::operator[](idx); }
143 
145  virtual Primitive *copy() const { return new TrianglePrimitive(*this); }
146 
148 
149  ICLGeom_API Vec computeNormal(const std::vector<Vec> &vertices) const;
150 
151  };
152 
154  struct QuadPrimitive : public math::FixedColVector<int,8>, public Primitive{
157 
160 
162 
165 
167  QuadPrimitive(int a, int b, int c, int d, const GeomColor &color, int na=-1, int nb=-1, int nc=-1, int nd=-1,
171 
173  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
174 
176  inline int i(int idx) const { return super::operator[](idx); }
177 
179  virtual Primitive *copy() const { return new QuadPrimitive(*this); }
180 
182 
183  ICLGeom_API Vec computeNormal(const std::vector<Vec> &vertices) const;
184  };
185 
187 
188  struct PolygonPrimitive : public Primitive{
189 
191 
196 
198  PolygonPrimitive(int n,const int *vidx, const GeomColor &color,const int *nidx=0):
199  Primitive(Primitive::polygon,color),idx(n,nidx?2:1){
200  std::copy(vidx,vidx+n,idx.begin());
201  if(nidx) std::copy(nidx,nidx+n,idx.begin()+n);
202  }
203 
205  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
206 
208  virtual Primitive *copy() const {
209  PolygonPrimitive *p = new PolygonPrimitive(*this);
210  p->idx.detach();
211  return p;
212  }
213 
215  inline int getNumPoints() const { return idx.getWidth(); }
216 
218  inline int getVertexIndex(int i) const { return idx(i,0); }
219 
221 
222  inline int getNormalIndex(int i) const { return idx(i,1); }
223 
225  inline bool hasNormals() const { return idx.getHeight() == 2; }
226  };
227 
233 
234  int alphaFunc;
235  float alphaValue;
236 
238  void setAlphaFunc(int func, float value){
239  alphaFunc = func;
240  alphaValue = value;
241  }
242 
244  };
245 
246 
248 
260 
262  TexturePrimitive(int a, int b, int c, int d,
263  const core::ImgBase *image=0, bool createTextureOnce=true,
264  int na=-1, int nb=-1, int nc=-1, int nd=-1, core::scalemode sm=core::interpolateLIN):
265  QuadPrimitive(a,b,c,d,geom_white(),na,nb,nc,nd), texture(image,sm),
266  image(createTextureOnce ? 0 : image){
268  }
269 
271  TexturePrimitive(int a, int b, int c, int d,
272  const core::Img8u &image,
273  int na=-1, int nb=-1, int nc=-1, int nd=-1, core::scalemode sm=core::interpolateLIN):
274  QuadPrimitive(a,b,c,d,geom_white(),na,nb,nc,nd), texture(&image,sm),
275  image(0){
277  }
278 
280  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
281 
283  virtual Primitive *copy() const {
284  return new TexturePrimitive(i(0),i(1),i(2),i(3),
286  !image,
287  i(4),i(5),i(6),i(7),
289  }
290 
291 
292  };
293 
295 
297  protected:
298  friend class SceneObject;
299  int w,h;
301  const icl32f *px, *py, *pz, *pnx, *pny, *pnz;
302  int stride;
304 
305  public:
307  const icl32f *px, const icl32f *py, const icl32f *pz,
308  const icl32f *pnx=0, const icl32f *pny=0, const icl32f *pnz=0,
309  int stride = 1,bool createTextureOnce=true,core::scalemode sm=core::interpolateLIN):
311  pnx(pnx),pny(pny),pnz(pnz),stride(stride),image(createTextureOnce ? 0 : image){}
312 
313  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
314 
315  virtual Primitive *copy() const {
319  }
320  ICLGeom_API void getAABB(utils::Range32f aabb[3]);
321 
322  inline Vec getPos(int x, int y) const {
323  const int idx = stride*(x + w*y);
324  return Vec(px[idx],py[idx],pz[idx],1);
325  }
326  };
327 
331  public:
333  const icl32f *px, const icl32f *py, const icl32f *pz,
334  const icl32f *pnx=0, const icl32f *pny=0, const icl32f *pnz=0,
335  int stride = 1,bool createFrontOnce=true,
336  bool createBackOnce=true, core::scalemode sm=core::interpolateLIN):
337  TextureGridPrimitive(w,h,front,px,py,pz,pnx,pny,pnz,stride,createFrontOnce,sm),back(back,sm),
338  iback(createBackOnce ? 0 : back){}
339 
340  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
341 
343  ICLGeom_API void setTextures(const core::ImgBase *front, const core::ImgBase *back);
344  };
345 
346 
349  public:
350  int w,h;
351  const Vec *vertices, *normals;
354 
355  inline int getIdx(int x, int y) const { return x+w*y; }
356  TwoSidedGridPrimitive(int w, int h, const Vec *vertices, const Vec *normals=0,
357  const GeomColor &frontColor=GeomColor(0,100,255,255),
358  const GeomColor &backColor=GeomColor(255,0,100,255),
359  const GeomColor &lineColor=GeomColor(0,255,100,255),
360  bool drawLines=false, bool drawQuads=true):
362  front(frontColor*(1./255)),back(backColor*(1./255)),lines(lineColor*(1./255)),
364 
365  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
366 
367  virtual Primitive *copy() const{
368  return new TwoSidedGridPrimitive(w,h,vertices, normals, front*255, back*255,
370  }
371  inline const Vec &getPos(int x, int y) const {
372  return vertices[x+w*y];
373  }
374  };
375 
377 
381 
383  SharedTexturePrimitive(int a, int b, int c, int d,
384  int sharedTextureIndex,
385  int na=-1, int nb=-1, int nc=-1, int nd=-1):
388  }
389 
391  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
392 
394  virtual Primitive *copy() const {
395  return new SharedTexturePrimitive(*this);
396  }
397  };
398 
403 
404  std::vector<Vec> ps;
405  std::vector<utils::Point32f> texCoords;
406  std::vector<Vec> normals;
407 
409  std::vector<int> vertexIndices;
410  std::vector<int> normalIndices;
411 
414  const float *xs, const float *ys, const float *zs, int xyzStride,
415  const utils::Point32f *texCoords, const float *nxs=0, const float *nys=0,
416  const float *nzs=0, int nxyzStride=1, bool createTextureOnce=true);
417 
419  ICLGeom_API GenericTexturePrimitive(const core::ImgBase *image, int numPoints, const int *vertexIndices,
420  const utils::Point32f *texCoords, const int *normalIndices = 0,
421  bool createTextureOnce=true);
422 
424  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
425 
427  virtual Primitive *copy() const {
429  cpy->texture = new qt::GLImg(image ? image : texture->extractImage());
430  return cpy;
431  }
432  };
433 
435 
438  int textSize;
439 
442 
444  ICLGeom_API static core::Img8u create_texture(const std::string &text, const GeomColor &color, int textSize);
445 
447 
450 
452  ICLGeom_API TextPrimitive(int a, int b, int c, int d,
453  const std::string &text,
454  int textSize=20,
455  const GeomColor &textColor=GeomColor(255,255,255,255),
456  int na=-1, int nb=-1, int nc=-1, int nd=-1,
457  float billboardHeight=0,
460 
462  ICLGeom_API virtual void render(const Primitive::RenderContext &ctx);
463 
465  virtual Primitive *copy() const {
467  p->type = text;
468  return p;
469  }
470 
472  inline void updateText(const std::string &newText){
474  texture.update(&t);
475  }
476 
477  };
478 
479 
480  } // namespace geom
481 }
482 
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
std::vector< utils::Point32f > texCoords
Definition: Primitive.h:405
Definition: Primitive.h:70
Definition: Types.h:86
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