Choreonoid  1.8
SceneDrawables.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_UTIL_SCENE_DRAWABLES_H
7 #define CNOID_UTIL_SCENE_DRAWABLES_H
8 
9 #include "SceneGraph.h"
10 #include "Image.h"
11 #include <cnoid/stdx/variant>
12 #include <memory>
13 #include <initializer_list>
14 #include "exportdecl.h"
15 
16 namespace cnoid {
17 
18 class CNOID_EXPORT SgMaterial : public SgObject
19 {
20 public:
21  SgMaterial();
22  SgMaterial(const SgMaterial& org);
23 
24  float ambientIntensity() const { return ambientIntensity_; }
25  void setAmbientIntensity(float intensity) { ambientIntensity_ = intensity; }
26  const Vector3f& diffuseColor() const { return diffuseColor_; }
27  template<typename Derived> void setDiffuseColor(const Eigen::MatrixBase<Derived>& c) {
28  diffuseColor_ = c.template cast<Vector3f::Scalar>(); }
29  const Vector3f& emissiveColor() const { return emissiveColor_; }
30  template<typename Derived> void setEmissiveColor(const Eigen::MatrixBase<Derived>& c) {
31  emissiveColor_ = c.template cast<Vector3f::Scalar>(); }
32 
33  const Vector3f& specularColor() const { return specularColor_; }
34  template<typename Derived> void setSpecularColor(const Eigen::MatrixBase<Derived>& c) {
35  specularColor_ = c.template cast<Vector3f::Scalar>(); }
36 
37  float specularExponent() const { return specularExponent_; }
38  void setSpecularExponent(float e) { specularExponent_ = e; }
39 
40  // The specification of this value comforms to the shininess of VRML97
41  [[deprecated("Use specularExponent")]]
42  float shininess() const;
43 
44  // The specification of this value comforms to the shininess of VRML97
45  [[deprecated("Use setSpecularExponent")]]
46  void setShininess(float s);
47 
48  float transparency() const { return transparency_; }
49  void setTransparency(float t) { transparency_ = t; }
50 
51 protected:
52  virtual Referenced* doClone(CloneMap* cloneMap) const override;
53 
54 private:
55  Vector3f diffuseColor_;
56  Vector3f emissiveColor_;
57  Vector3f specularColor_;
58  float ambientIntensity_;
59  float transparency_;
60  float specularExponent_;
61 };
62 
64 
65 
66 class CNOID_EXPORT SgImage : public SgObject
67 {
68 public:
69  SgImage();
70  SgImage(const Image& image);
71  SgImage(std::shared_ptr<Image> sharedImage);
72  SgImage(const SgImage& org);
73 
74  Image& image();
75  const Image& image() const { return *image_; }
76  const Image& constImage() const { return *image_; }
77 
78  bool empty() const { return image_->empty(); }
79 
80  unsigned char* pixels();
81  const unsigned char* pixels() const { return image_->pixels(); }
82  const unsigned char* constPixels() const { return image_->pixels(); }
83 
84  int width() const { return image_->width(); }
85  int height() const { return image_->height(); }
86  int numComponents() const { return image_->numComponents(); }
87 
88  void setSize(int width, int height, int nComponents);
89  void setSize(int width, int height);
90 
91 protected:
92  virtual Referenced* doClone(CloneMap* cloneMap) const override;
93 
94 private:
95  std::shared_ptr<Image> image_;
96 };
97 
99 
100 
101 class CNOID_EXPORT SgTextureTransform : public SgObject
102 {
103 public:
104  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
105 
108 
109  const Vector2& center() const { return center_; }
110  template<typename Derived> void setCenter(const Eigen::MatrixBase<Derived>& c) {
111  center_ = c.template cast<Vector3::Scalar>(); }
112  double rotation() const { return rotation_; }
113  void setRotation(double rotation) { rotation_ = rotation; }
114  const Vector2& scale() const { return scale_; }
115  template<typename Derived> void setScale(const Eigen::MatrixBase<Derived>& c) {
116  scale_ = c.template cast<Vector2::Scalar>(); }
117  const Vector2& translation() const { return translation_; }
118  template<typename Derived> void setTranslation(const Eigen::MatrixBase<Derived>& c) {
119  translation_ = c.template cast<Vector3::Scalar>(); }
120 
121 protected:
122  virtual Referenced* doClone(CloneMap* cloneMap) const override;
123 
124 private:
125  Vector2 center_;
126  Vector2 scale_;
127  Vector2 translation_;
128  double rotation_;
129 };
130 
132 
133 
134 class CNOID_EXPORT SgTexture : public SgObject
135 {
136 public:
137  SgTexture();
138  SgTexture(const SgTexture& org, CloneMap* cloneMap = nullptr);
139  ~SgTexture();
140 
141  virtual int numChildObjects() const override;
142  virtual SgObject* childObject(int index) override;
143 
144  SgImage* image() { return image_; }
145  const SgImage* image() const { return image_; }
146  SgImage* setImage(SgImage* image);
147  SgImage* getOrCreateImage();
148 
149  bool repeatS() const { return repeatS_; }
150  bool repeatT() const { return repeatT_; }
151  void setRepeat(bool s, bool t) { repeatS_ = s; repeatT_ = t; }
152 
153  SgTextureTransform* textureTransform() { return textureTransform_; }
154  const SgTextureTransform* textureTransform() const { return textureTransform_; }
155  SgTextureTransform* setTextureTransform(SgTextureTransform* textureTransform);
156  SgTextureTransform* getOrCreateTextureTransform();
157 
158 protected:
159  virtual Referenced* doClone(CloneMap* cloneMap) const override;
160 
161 private:
162  SgImagePtr image_;
163  SgTextureTransformPtr textureTransform_;
164  bool repeatS_;
165  bool repeatT_;
166 };
167 
169 
170 
171 template<class T, class Alloc = std::allocator<T>> class SgVectorArray : public SgObject
172 {
173  typedef std::vector<T> Container;
174 
175 public:
176  typedef typename Container::iterator iterator;
177  typedef typename Container::const_iterator const_iterator;
178  typedef typename Container::size_type size_type;
179  typedef typename Container::value_type value_type;
180  typedef typename Container::reference reference;
181  typedef typename Container::const_reference const_reference;
182  typedef typename Container::pointer pointer;
183  typedef typename Container::const_pointer const_pointer;
184  typedef typename T::Scalar Scalar;
185 
187  SgVectorArray(size_t size) : values(size) { }
188  SgVectorArray(const std::vector<T>& org) : values(org) { }
189  SgVectorArray(std::initializer_list<T> init) : values(init) { }
190 
191  template<class Element>
192  SgVectorArray(const std::vector<Element>& org) {
193  values.reserve(org.size());
194  for(typename std::vector<Element>::const_iterator p = org.begin(); p != org.end(); ++p){
195  values.push_back(p->template cast<typename T::Scalar>());
196  }
197  }
198 
199  SgVectorArray(const SgVectorArray& org) : SgObject(org), values(org.values) { }
200 
202  values = rhs.values;
203  return *this;
204  }
205  iterator begin() { return values.begin(); }
206  const_iterator begin() const { return values.begin(); }
207  iterator end() { return values.end(); }
208  const_iterator end() const { return values.end(); }
209  size_type size() const { return values.size(); }
210  void resize(size_type s) { values.resize(s); }
211  void resize(size_type s, const T& v) { values.resize(s, v); }
212  bool empty() const { return values.empty(); }
213  void reserve(size_type s) { values.reserve(s); }
214  size_type capacity() const { return values.capacity(); }
215  T& operator[](size_type i) { return values[i]; }
216  const T& operator[](size_type i) const { return values[i]; }
217  T& at(size_type i) { return values[i]; }
218  const T& at(size_type i) const { return values[i]; }
219  T& front() { return values.front(); }
220  const T& front() const { return values.front(); }
221  T& back() { return values.back(); }
222  const T& back() const { return values.back(); }
223  Scalar* data() { return values.front().data(); }
224  const Scalar* data() const { return values.front().data(); }
225  iterator insert(const_iterator pos, std::initializer_list<T> il){ return values.insert(pos, il); }
226  void push_back(const T& v) { values.push_back(v); }
227  template<class... Args> void emplace_back(Args&&... args) { values.emplace_back(args...); }
228  void pop_back() { values.pop_back(); }
229  iterator erase(iterator p) { return values.erase(p); }
230  iterator erase(iterator first, iterator last) { return values.erase(first, last); }
231  void clear() { values.clear(); }
232  void shrink_to_fit() { values.shrink_to_fit(); }
233 
234 protected:
235  virtual Referenced* doClone(CloneMap*) const override { return new SgVectorArray(*this); }
236 
237 private:
238  Container values;
239 };
240 
243 
246 
249 
252 
253 typedef std::vector<int> SgIndexArray;
254 
255 
256 class CNOID_EXPORT SgMeshBase : public SgObject
257 {
258 protected:
259  SgMeshBase();
260  SgMeshBase(const SgMeshBase& org, CloneMap* cloneMap = nullptr);
261  ~SgMeshBase();
262 
263 public:
264  virtual int numChildObjects() const override;
265  virtual SgObject* childObject(int index) override;
266 
267  const BoundingBox& boundingBox() const { return bbox; }
268  virtual void updateBoundingBox();
269  void setBoundingBox(const BoundingBox& bb){ bbox = bb; };
270  void setBoundingBox(const BoundingBoxf& bb){ bbox = bb; };
271 
272  bool hasVertices() const { return (vertices_ && !vertices_->empty()); }
273  SgVertexArray* vertices() { return vertices_; }
274  const SgVertexArray* vertices() const { return vertices_; }
275  SgVertexArray* setVertices(SgVertexArray* vertices);
276  SgVertexArray* getOrCreateVertices(int size = 0);
277 
278  bool hasNormals() const { return (normals_ && !normals_->empty()); }
279  SgNormalArray* normals() { return normals_; }
280  const SgNormalArray* normals() const { return normals_; }
281  SgNormalArray* setNormals(SgNormalArray* normals);
282  SgNormalArray* getOrCreateNormals();
283 
284  bool hasColors() const { return (colors_ && !colors_->empty()); }
285  SgColorArray* colors() { return colors_; }
286  const SgColorArray* colors() const { return colors_; }
287  SgColorArray* setColors(SgColorArray* colors);
288  SgColorArray* getOrCreateColors(int size = 0);
289 
290  bool hasTexCoords() const { return (texCoords_ && !texCoords_->empty()); }
291  SgTexCoordArray* texCoords() { return texCoords_; }
292  const SgTexCoordArray* texCoords() const { return texCoords_; }
293  SgTexCoordArray* setTexCoords(SgTexCoordArray* texCoords);
294  SgTexCoordArray* getOrCreateTexCoords();
295 
296  bool hasFaceVertexIndices() const { return !faceVertexIndices_.empty(); }
297  const SgIndexArray& faceVertexIndices() const { return faceVertexIndices_; }
298  SgIndexArray& faceVertexIndices() { return faceVertexIndices_; }
302  bool hasNormalIndices() const { return !normalIndices_.empty(); }
303  const SgIndexArray& normalIndices() const { return normalIndices_; }
304  SgIndexArray& normalIndices() { return normalIndices_; }
305 
306  bool hasColorIndices() const { return !colorIndices_.empty(); }
307  const SgIndexArray& colorIndices() const { return colorIndices_; }
308  SgIndexArray& colorIndices() { return colorIndices_; }
309 
310  bool hasTexCoordIndices() const { return !texCoordIndices_.empty(); }
311  const SgIndexArray& texCoordIndices() const { return texCoordIndices_; }
312  SgIndexArray& texCoordIndices() { return texCoordIndices_; }
313 
314  float creaseAngle() const { return creaseAngle_; }
315  void setCreaseAngle(float angle) { creaseAngle_ = angle; }
316 
317  bool isSolid() const { return isSolid_; }
318  void setSolid(bool on) { isSolid_ = on; }
319 
320 protected:
331  bool isSolid_;
332 };
333 
335 
336 
337 class CNOID_EXPORT SgMesh : public SgMeshBase
338 {
339 public:
340  SgMesh();
341  SgMesh(const SgMesh& org, CloneMap* cloneMap = nullptr);
342 
343  virtual void updateBoundingBox() override;
344 
348  const SgIndexArray& triangleVertices() const { return faceVertexIndices_; }
349  SgIndexArray& triangleVertices() { return faceVertexIndices_; }
350 
351  bool hasTriangles() const { return !faceVertexIndices_.empty(); }
352  int numTriangles() const { return static_cast<int>(faceVertexIndices_.size()) / 3; }
353  void setNumTriangles(int n) { faceVertexIndices_.resize(n * 3); }
354  void reserveNumTriangles(int n) { faceVertexIndices_.reserve(n * 3); }
355 
356  typedef Eigen::Map<Array3i> TriangleRef;
357  TriangleRef triangle(int index){
358  return TriangleRef(&faceVertexIndices_[index * 3]);
359  }
360 
361  typedef Eigen::Map<const Array3i> ConstTriangleRef;
362  ConstTriangleRef triangle(int index) const {
363  return ConstTriangleRef(&faceVertexIndices_[index * 3]);
364  }
365 
366  void setTriangle(int index, int v0, int v1, int v2){
367  const int i = index * 3;
368  faceVertexIndices_[i+0] = v0;
369  faceVertexIndices_[i+1] = v1;
370  faceVertexIndices_[i+2] = v2;
371  }
372 
374  const size_t s = faceVertexIndices_.size();
375  faceVertexIndices_.resize(s + 3);
376  return TriangleRef(&faceVertexIndices_[s]);
377  }
378 
379  // deprecated
380  TriangleRef addTriangle(){ return newTriangle(); }
381 
382  void addTriangles(std::initializer_list<Array3i> il){
383  faceVertexIndices_.reserve(faceVertexIndices_.size() + il.size() * 3);
384  for(auto& v : il){
385  for(int i=0; i < 3; ++i){
386  faceVertexIndices_.push_back(v[i]);
387  }
388  }
389  }
390 
391  void addTriangle(int v0, int v1, int v2){
392  faceVertexIndices_.push_back(v0);
393  faceVertexIndices_.push_back(v1);
394  faceVertexIndices_.push_back(v2);
395  }
396 
404 
405  // deprecated
406  MESH = MeshType,
407  BOX = BoxType,
408  SPHERE = SphereType,
409  CYLINDER = CylinderType,
410  CONE = ConeType,
411  CAPSULE = CapsuleType
412  };
413 
414  class Mesh { }; // defined for no primitive information
415 
416  class Box {
417  public:
418  Box() : Box(Vector3(1.0, 1.0, 1.0)) { }
419  Box(Vector3 size) : size(size) { }
421  };
422  class Sphere {
423  public:
424  Sphere() : Sphere(1.0) { }
425  Sphere(double radius) : radius(radius) { }
426  double radius;
427  };
428  class Cylinder {
429  public:
430  Cylinder() : Cylinder(1.0, 1.0) { }
431  Cylinder(double radius, double height) :
432  radius(radius), height(height), top(true), bottom(true), side(true) { }
433  double radius;
434  double height;
435  bool top;
436  bool bottom;
437  bool side;
438  };
439  class Cone {
440  public:
441  Cone() : Cone(1.0, 1.0) { }
442  Cone(double radius, double height) :
443  radius(radius), height(height), bottom(true), side(true) { }
444  double radius;
445  double height;
446  bool bottom;
447  bool side;
448  };
449  class Capsule {
450  public:
451  Capsule() : Capsule(1.0, 1.0) { }
452  Capsule(double radius, double height) :
453  radius(radius), height(height) { }
454  double radius;
455  double height;
456  };
457 
458  typedef stdx::variant<Mesh, Box, Sphere, Cylinder, Cone, Capsule> Primitive;
459 
460  SgMesh(Primitive primitive);
461 
462  const int primitiveType() const { return stdx::get_variant_index(primitive_); }
463  template<class TPrimitive> const TPrimitive& primitive() const { return stdx::get<TPrimitive>(primitive_); }
464  void setPrimitive(Primitive prim) { primitive_ = prim; }
465 
467  int divisionNumber() const { return divisionNumber_; }
468  void setDivisionNumber(int n) { divisionNumber_ = n; }
469 
471  int extraDivisionNumber() const { return extraDivisionNumber_; }
472  void setExtraDivisionNumber(int n) { extraDivisionNumber_ = n; }
473 
476  ExtraDivisionPreferred = 0,
477  ExtraDivisionX = 1,
478  ExtraDivisionY = 2,
479  ExtraDivisionZ = 4,
480  ExtraDivisionAll = ExtraDivisionX | ExtraDivisionY | ExtraDivisionZ
481  };
482  int extraDivisionMode() const { return extraDivisionMode_; }
483  void setExtraDivisionMode(int mode) { extraDivisionMode_ = mode; }
484 
485  void transform(const Affine3& T);
486  void transform(const Affine3f& T);
487  void translate(const Vector3f& translation);
488  void rotate(const Matrix3f& R);
489 
490 protected:
491  virtual Referenced* doClone(CloneMap* cloneMap) const override;
492 
493 private:
494  Primitive primitive_;
495  short divisionNumber_;
496  short extraDivisionNumber_;
497  short extraDivisionMode_;
498 };
499 
501 
502 
503 class CNOID_EXPORT SgPolygonMesh : public SgMeshBase
504 {
505 public:
506  SgPolygonMesh();
507  SgPolygonMesh(const SgPolygonMesh& org, CloneMap* cloneMap = nullptr);
508 
509  virtual void updateBoundingBox() override;
510 
518  [[deprecated("Use faceVertexIndices")]]
519  SgIndexArray& polygonVertices() { return faceVertexIndices_; }
520  [[deprecated("Use faceVertexIndices")]]
521  const SgIndexArray& polygonVertices() const { return faceVertexIndices_; }
522 
523 protected:
524  virtual Referenced* doClone(CloneMap* cloneMap) const override;
525 };
526 
528 
529 
530 class CNOID_EXPORT SgShape : public SgNode
531 {
532 public:
533  SgShape();
534  SgShape(const SgShape& org, CloneMap* cloneMap = nullptr);
535  ~SgShape();
536 
537  virtual int numChildObjects() const override;
538  virtual SgObject* childObject(int index) override;
539  virtual const BoundingBox& boundingBox() const override;
540  virtual const BoundingBox& untransformedBoundingBox() const override;
541 
542  SgMesh* mesh() { return mesh_; }
543  const SgMesh* mesh() const { return mesh_; }
544  SgMesh* setMesh(SgMesh* mesh);
545  SgMesh* getOrCreateMesh();
546 
547  SgMaterial* material() { return material_; }
548  const SgMaterial* material() const { return material_; }
549  SgMaterial* setMaterial(SgMaterial* material);
550  SgMaterial* getOrCreateMaterial();
551 
552  SgTexture* texture() { return texture_; }
553  const SgTexture* texture() const { return texture_; }
554  SgTexture* setTexture(SgTexture* texture);
555  SgTexture* getOrCreateTexture();
556 
557 protected:
558  SgShape(int classId);
559  virtual Referenced* doClone(CloneMap* cloneMap) const override;
560 
561 private:
562  SgMeshPtr mesh_;
563  SgMaterialPtr material_;
564  SgTexturePtr texture_;
565 };
566 
568 
569 
570 class CNOID_EXPORT SgPlot : public SgNode
571 {
572 protected:
573  SgPlot(int classId);
574  SgPlot(const SgPlot& org, CloneMap* cloneMap = nullptr);
575  ~SgPlot();
576 
577 public:
578 
579  virtual int numChildObjects() const override;
580  virtual SgObject* childObject(int index) override;
581 
582  virtual const BoundingBox& boundingBox() const override;
583  virtual const BoundingBox& untransformedBoundingBox() const override;
584  void updateBoundingBox();
585 
586  void clear();
587 
588  bool hasVertices() const { return (vertices_ && !vertices_->empty()); }
589  SgVertexArray* vertices() { return vertices_; }
590  const SgVertexArray* vertices() const { return vertices_; }
591  SgVertexArray* setVertices(SgVertexArray* vertices);
592  SgVertexArray* getOrCreateVertices(int size = 0);
593 
594  SgMaterial* material() { return material_; }
595  const SgMaterial* material() const { return material_; }
596  SgMaterial* setMaterial(SgMaterial* material);
597  SgMaterial* getOrCreateMaterial();
598 
599  bool hasColors() const { return (colors_ && !colors_->empty()); }
600  SgColorArray* colors() { return colors_; }
601  const SgColorArray* colors() const { return colors_; }
602  SgColorArray* setColors(SgColorArray* colors);
603  SgColorArray* getOrCreateColors(int size = 0);
604 
605  const SgIndexArray& colorIndices() const { return colorIndices_; }
606  SgIndexArray& colorIndices() { return colorIndices_; }
607 
615  bool hasNormals() const { return (normals_ && !normals_->empty()); }
616  SgNormalArray* normals() { return normals_; }
617  const SgNormalArray* normals() const { return normals_; }
618  SgNormalArray* setNormals(SgNormalArray* normals);
619  SgVertexArray* getOrCreateNormals();
620  const SgIndexArray& normalIndices() const { return normalIndices_; }
621  SgIndexArray& normalIndices() { return normalIndices_; }
622 
623 private:
624  BoundingBox bbox;
625  SgVertexArrayPtr vertices_;
626  SgMaterialPtr material_;
627  SgColorArrayPtr colors_;
628  SgIndexArray colorIndices_;
629  SgNormalArrayPtr normals_;
630  SgIndexArray normalIndices_;
631 };
632 
634 
635 
636 class CNOID_EXPORT SgPointSet : public SgPlot
637 {
638 public:
639  SgPointSet();
640  SgPointSet(const SgPointSet& org, CloneMap* cloneMap = nullptr);
641 
642  void setPointSize(double size) { pointSize_ = size; }
643 
647  double pointSize() const { return pointSize_; }
648 
649 protected:
650  SgPointSet(int classId);
651  virtual Referenced* doClone(CloneMap* cloneMap) const override;
652 
653 private:
654  double pointSize_;
655 };
656 
658 
659 
660 class CNOID_EXPORT SgLineSet : public SgPlot
661 {
662 public:
663  SgLineSet();
664  SgLineSet(const SgLineSet& org, CloneMap* cloneMap = nullptr);
665 
666  const SgIndexArray& lineVertexIndices() const { return lineVertexIndices_; }
667  SgIndexArray& lineVertexIndices() { return lineVertexIndices_; }
668 
670  [[deprecated("Use lineVertexIndices()")]]
671  const SgIndexArray& lineVertices() const { return lineVertexIndices_; }
672 
673  [[deprecated("Use lineVertexIndices()")]]
675  SgIndexArray& lineVertices() { return lineVertexIndices_; }
676 
677  int numLines() const { return static_cast<int>(lineVertexIndices_.size()) / 2; }
678  void setNumLines(int n) { lineVertexIndices_.resize(n * 2); }
679  void reserveNumLines(int n) { lineVertexIndices_.reserve(n * 2); }
680  void clearLines() { lineVertexIndices_.clear(); }
681 
682  typedef Eigen::Map<Array2i> LineRef;
683  LineRef line(int index){
684  return LineRef(&lineVertexIndices_[index * 2]);
685  }
686 
687  typedef Eigen::Map<const Array2i> ConstLineRef;
688  ConstLineRef line(int index) const {
689  return ConstLineRef(&lineVertexIndices_[index * 2]);
690  }
691 
692  void setLine(int index, int v0, int v1){
693  const int i = index * 2;
694  lineVertexIndices_[i+0] = v0;
695  lineVertexIndices_[i+1] = v1;
696  }
697 
699  const size_t s = lineVertexIndices_.size();
700  lineVertexIndices_.resize(s + 2);
701  return LineRef(&lineVertexIndices_[s]);
702  }
703 
704  void addLine(int v0, int v1){
705  lineVertexIndices_.push_back(v0);
706  lineVertexIndices_.push_back(v1);
707  }
708 
710  colorIndices().resize(n * 2);
711  }
712 
713  void setLineColor(int lineIndex, int colorIndex){
714  colorIndices()[lineIndex * 2 ] = colorIndex;
715  colorIndices()[lineIndex * 2 + 1] = colorIndex;
716  }
717 
718  void setLineWidth(float width) { lineWidth_ = width; }
719 
723  float lineWidth() const { return lineWidth_; }
724 
725 protected:
726  SgLineSet(int classId);
727  virtual Referenced* doClone(CloneMap* cloneMap) const override;
728 
729 private:
730  SgIndexArray lineVertexIndices_;
731  float lineWidth_;
732 };
733 
735 
736 
737 class CNOID_EXPORT SgOverlay : public SgGroup
738 {
739 public:
740  SgOverlay();
741  SgOverlay(const SgOverlay& org, CloneMap* cloneMap = nullptr);
742  ~SgOverlay();
743 
744 protected:
745  SgOverlay(int classId);
746  virtual Referenced* doClone(CloneMap* cloneMap) const override;
747 };
748 
750 
751 
752 class CNOID_EXPORT SgViewportOverlay : public SgOverlay
753 {
754 public:
756  SgViewportOverlay(const SgViewportOverlay& org, CloneMap* cloneMap = nullptr);
758 
759  struct ViewVolume {
760  double left;
761  double right;
762  double bottom;
763  double top;
764  double zNear;
765  double zFar;
766  };
767 
768  virtual void calcViewVolume(double viewportWidth, double viewportHeight, ViewVolume& io_volume);
769 
770 protected:
771  SgViewportOverlay(int classId);
772  virtual Referenced* doClone(CloneMap* cloneMap) const override;
773 };
774 
776 
777 }
778 
779 #endif
cnoid::SgVectorArray::operator[]
T & operator[](size_type i)
Definition: SceneDrawables.h:215
cnoid::SgMeshBase::normals_
SgNormalArrayPtr normals_
Definition: SceneDrawables.h:324
cnoid::SgPointSet::setPointSize
void setPointSize(double size)
Definition: SceneDrawables.h:642
cnoid::Vector2
Eigen::Vector2d Vector2
Definition: EigenTypes.h:55
cnoid::SgImage
Definition: SceneDrawables.h:66
cnoid::SgMesh::setExtraDivisionNumber
void setExtraDivisionNumber(int n)
Definition: SceneDrawables.h:472
cnoid::SgTexture::textureTransform
const SgTextureTransform * textureTransform() const
Definition: SceneDrawables.h:154
cnoid::SgTextureTransform::setScale
void setScale(const Eigen::MatrixBase< Derived > &c)
Definition: SceneDrawables.h:115
cnoid::SgTextureTransformPtr
ref_ptr< SgTextureTransform > SgTextureTransformPtr
Definition: SceneDrawables.h:131
cnoid::SgMeshBase::creaseAngle_
float creaseAngle_
Definition: SceneDrawables.h:330
cnoid::SgMesh::ConstTriangleRef
Eigen::Map< const Array3i > ConstTriangleRef
Definition: SceneDrawables.h:361
cnoid::SgTexture::image
const SgImage * image() const
Definition: SceneDrawables.h:145
cnoid::SgPlot::hasVertices
bool hasVertices() const
Definition: SceneDrawables.h:588
cnoid::SgMesh::Cylinder
Definition: SceneDrawables.h:428
cnoid::SgVectorArray::front
T & front()
Definition: SceneDrawables.h:219
cnoid::SgTexturePtr
ref_ptr< SgTexture > SgTexturePtr
Definition: SceneDrawables.h:168
cnoid::SgLineSet::clearLines
void clearLines()
Definition: SceneDrawables.h:680
cnoid::SgMesh::reserveNumTriangles
void reserveNumTriangles(int n)
Definition: SceneDrawables.h:354
cnoid::SgMaterial::setTransparency
void setTransparency(float t)
Definition: SceneDrawables.h:49
cnoid::SgMesh::Capsule
Definition: SceneDrawables.h:449
cnoid::SgPlot::normalIndices
const SgIndexArray & normalIndices() const
Definition: SceneDrawables.h:620
cnoid::SgMesh::primitive
const TPrimitive & primitive() const
Definition: SceneDrawables.h:463
cnoid::SgMesh::addTriangles
void addTriangles(std::initializer_list< Array3i > il)
Definition: SceneDrawables.h:382
cnoid::SgImagePtr
ref_ptr< SgImage > SgImagePtr
Definition: SceneDrawables.h:98
cnoid::SgLineSet::lineVertices
const SgIndexArray & lineVertices() const
Definition: SceneDrawables.h:671
cnoid::SgVectorArray::pointer
Container::pointer pointer
Definition: SceneDrawables.h:182
cnoid::SgPolygonMesh::polygonVertices
const SgIndexArray & polygonVertices() const
Definition: SceneDrawables.h:521
cnoid::Vector3
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
cnoid::SgVectorArray::empty
bool empty() const
Definition: SceneDrawables.h:212
cnoid::SgMesh::setNumTriangles
void setNumTriangles(int n)
Definition: SceneDrawables.h:353
cnoid::SgMesh::Cone::Cone
Cone(double radius, double height)
Definition: SceneDrawables.h:442
cnoid::SgPolygonMeshPtr
ref_ptr< SgPolygonMesh > SgPolygonMeshPtr
Definition: SceneDrawables.h:527
cnoid::SgMeshPtr
ref_ptr< SgMesh > SgMeshPtr
Definition: SceneDrawables.h:500
cnoid::SgMaterial::emissiveColor
const Vector3f & emissiveColor() const
Definition: SceneDrawables.h:29
cnoid::SgMeshBase::setBoundingBox
void setBoundingBox(const BoundingBoxf &bb)
Definition: SceneDrawables.h:270
cnoid::SgMeshBase::normalIndices
const SgIndexArray & normalIndices() const
Definition: SceneDrawables.h:303
cnoid::SgLineSetPtr
ref_ptr< SgLineSet > SgLineSetPtr
Definition: SceneDrawables.h:734
cnoid::SgMesh::Cone::Cone
Cone()
Definition: SceneDrawables.h:441
cnoid::SgMesh::extraDivisionMode
int extraDivisionMode() const
Definition: SceneDrawables.h:482
cnoid::SgMesh
Definition: SceneDrawables.h:337
cnoid::SgLineSet::reserveNumLines
void reserveNumLines(int n)
Definition: SceneDrawables.h:679
cnoid::SgMesh::Cone::bottom
bool bottom
Definition: SceneDrawables.h:446
cnoid::SgMeshBase::colors_
SgColorArrayPtr colors_
Definition: SceneDrawables.h:326
cnoid::SgTextureTransform::translation
const Vector2 & translation() const
Definition: SceneDrawables.h:117
cnoid::SgVectorArray::size_type
Container::size_type size_type
Definition: SceneDrawables.h:178
cnoid::SgMesh::Primitive
stdx::variant< Mesh, Box, Sphere, Cylinder, Cone, Capsule > Primitive
Definition: SceneDrawables.h:458
cnoid::SgPlot::material
const SgMaterial * material() const
Definition: SceneDrawables.h:595
cnoid::SgShape::mesh
SgMesh * mesh()
Definition: SceneDrawables.h:542
cnoid::SgTextureTransform::setRotation
void setRotation(double rotation)
Definition: SceneDrawables.h:113
cnoid::SgPlot
Definition: SceneDrawables.h:570
cnoid::SgColorArrayPtr
ref_ptr< SgColorArray > SgColorArrayPtr
Definition: SceneDrawables.h:248
cnoid::SgMesh::triangleVertices
SgIndexArray & triangleVertices()
Definition: SceneDrawables.h:349
cnoid::SgVectorArray::erase
iterator erase(iterator first, iterator last)
Definition: SceneDrawables.h:230
cnoid::SgVectorArray::const_reference
Container::const_reference const_reference
Definition: SceneDrawables.h:181
cnoid::SgMaterial::specularColor
const Vector3f & specularColor() const
Definition: SceneDrawables.h:33
cnoid::SgGroup
Definition: SceneGraph.h:220
cnoid::SgMeshBase::texCoordIndices
const SgIndexArray & texCoordIndices() const
Definition: SceneDrawables.h:311
cnoid::SgMesh::Sphere::Sphere
Sphere(double radius)
Definition: SceneDrawables.h:425
cnoid::SgMeshBase::setCreaseAngle
void setCreaseAngle(float angle)
Definition: SceneDrawables.h:315
cnoid::SgVertexArrayPtr
ref_ptr< SgVertexArray > SgVertexArrayPtr
Definition: SceneDrawables.h:242
cnoid::SgMesh::Cone::height
double height
Definition: SceneDrawables.h:445
cnoid::SgVectorArray::emplace_back
void emplace_back(Args &&... args)
Definition: SceneDrawables.h:227
cnoid::SgMesh::Box::Box
Box(Vector3 size)
Definition: SceneDrawables.h:419
cnoid::SgLineSet
Definition: SceneDrawables.h:660
cnoid::SgMesh::Cylinder::radius
double radius
Definition: SceneDrawables.h:433
cnoid::SgVertexArray
SgVectorArray< Vector3f > SgVertexArray
Definition: SceneDrawables.h:241
cnoid::SgMeshBase::hasNormals
bool hasNormals() const
Definition: SceneDrawables.h:278
cnoid::SgMaterial::setSpecularColor
void setSpecularColor(const Eigen::MatrixBase< Derived > &c)
Definition: SceneDrawables.h:34
cnoid::SgMesh::Box::size
Vector3 size
Definition: SceneDrawables.h:420
cnoid::SgMesh::addTriangle
TriangleRef addTriangle()
Definition: SceneDrawables.h:380
cnoid::SgMaterial::specularExponent
float specularExponent() const
Definition: SceneDrawables.h:37
cnoid::SgImage::width
int width() const
Definition: SceneDrawables.h:84
cnoid::SgMesh::triangle
ConstTriangleRef triangle(int index) const
Definition: SceneDrawables.h:362
cnoid::SgMeshBase::bbox
BoundingBox bbox
Definition: SceneDrawables.h:321
cnoid::SgPolygonMesh::polygonVertices
SgIndexArray & polygonVertices()
Definition: SceneDrawables.h:519
cnoid::SgTextureTransform::rotation
double rotation() const
Definition: SceneDrawables.h:112
cnoid::SgMaterial::setSpecularExponent
void setSpecularExponent(float e)
Definition: SceneDrawables.h:38
cnoid::SgLineSet::lineVertices
SgIndexArray & lineVertices()
Definition: SceneDrawables.h:675
cnoid::SgLineSet::ConstLineRef
Eigen::Map< const Array2i > ConstLineRef
Definition: SceneDrawables.h:687
cnoid::SgVectorArray::resize
void resize(size_type s, const T &v)
Definition: SceneDrawables.h:211
cnoid::SgVectorArray
Definition: SceneDrawables.h:171
cnoid::SgVectorArray::data
Scalar * data()
Definition: SceneDrawables.h:223
cnoid::SgMeshBase::setBoundingBox
void setBoundingBox(const BoundingBox &bb)
Definition: SceneDrawables.h:269
cnoid::SgVectorArray::size
size_type size() const
Definition: SceneDrawables.h:209
cnoid::SgVectorArray::operator=
SgVectorArray< T > & operator=(const SgVectorArray< T > &rhs)
Definition: SceneDrawables.h:201
cnoid::SgVectorArray::clear
void clear()
Definition: SceneDrawables.h:231
cnoid::SgColorArray
SgVectorArray< Vector3f > SgColorArray
Definition: SceneDrawables.h:247
cnoid::SgMesh::Capsule::height
double height
Definition: SceneDrawables.h:455
cnoid::SgMeshBase::faceVertexIndices
SgIndexArray & faceVertexIndices()
Definition: SceneDrawables.h:298
cnoid::SgMeshBase::colorIndices_
SgIndexArray colorIndices_
Definition: SceneDrawables.h:327
cnoid::SgVectorArray::insert
iterator insert(const_iterator pos, std::initializer_list< T > il)
Definition: SceneDrawables.h:225
cnoid::SgMesh::Cylinder::side
bool side
Definition: SceneDrawables.h:437
cnoid::SgMeshBase::boundingBox
const BoundingBox & boundingBox() const
Definition: SceneDrawables.h:267
cnoid::SgPointSetPtr
ref_ptr< SgPointSet > SgPointSetPtr
Definition: SceneDrawables.h:657
cnoid::SgMesh::addTriangle
void addTriangle(int v0, int v1, int v2)
Definition: SceneDrawables.h:391
cnoid::SgMesh::divisionNumber
int divisionNumber() const
The value is -1 when the division number is not explicitly specified.
Definition: SceneDrawables.h:467
cnoid::BoundingBoxf
Definition: BoundingBox.h:61
cnoid::SgPlot::hasNormals
bool hasNormals() const
Definition: SceneDrawables.h:615
cnoid::SgMesh::Sphere::radius
double radius
Definition: SceneDrawables.h:426
cnoid::SgMesh::hasTriangles
bool hasTriangles() const
Definition: SceneDrawables.h:351
cnoid::SgImage::pixels
const unsigned char * pixels() const
Definition: SceneDrawables.h:81
cnoid::SgMaterial::setAmbientIntensity
void setAmbientIntensity(float intensity)
Definition: SceneDrawables.h:25
cnoid::SgVectorArray::SgVectorArray
SgVectorArray(const std::vector< Element > &org)
Definition: SceneDrawables.h:192
cnoid::SgVectorArray::end
const_iterator end() const
Definition: SceneDrawables.h:208
cnoid::SgVectorArray::const_iterator
Container::const_iterator const_iterator
Definition: SceneDrawables.h:177
cnoid::SgMaterial::transparency
float transparency() const
Definition: SceneDrawables.h:48
cnoid::SgShape::material
const SgMaterial * material() const
Definition: SceneDrawables.h:548
cnoid::SgVectorArray::SgVectorArray
SgVectorArray()
Definition: SceneDrawables.h:186
cnoid::SgImage::empty
bool empty() const
Definition: SceneDrawables.h:78
cnoid::SgVectorArray::SgVectorArray
SgVectorArray(std::initializer_list< T > init)
Definition: SceneDrawables.h:189
cnoid::SgMesh::Cylinder::top
bool top
Definition: SceneDrawables.h:435
cnoid::SgTextureTransform::setCenter
void setCenter(const Eigen::MatrixBase< Derived > &c)
Definition: SceneDrawables.h:110
cnoid::SgShape::mesh
const SgMesh * mesh() const
Definition: SceneDrawables.h:543
cnoid::SgMeshBase::hasTexCoordIndices
bool hasTexCoordIndices() const
Definition: SceneDrawables.h:310
cnoid::SgShape::texture
SgTexture * texture()
Definition: SceneDrawables.h:552
cnoid::SgMesh::ConeType
@ ConeType
Definition: SceneDrawables.h:402
cnoid::SgMeshBase::vertices_
SgVertexArrayPtr vertices_
Definition: SceneDrawables.h:322
cnoid::SgMeshBase::isSolid
bool isSolid() const
Definition: SceneDrawables.h:317
cnoid::SgTexture::textureTransform
SgTextureTransform * textureTransform()
Definition: SceneDrawables.h:153
cnoid::SgVectorArray::begin
iterator begin()
Definition: SceneDrawables.h:205
cnoid::SgMeshBase::hasTexCoords
bool hasTexCoords() const
Definition: SceneDrawables.h:290
cnoid::SgTexture::setRepeat
void setRepeat(bool s, bool t)
Definition: SceneDrawables.h:151
cnoid::SgMesh::Box
Definition: SceneDrawables.h:416
cnoid::ref_ptr< SgMaterial >
cnoid::SgMeshBase::creaseAngle
float creaseAngle() const
Definition: SceneDrawables.h:314
cnoid::SgLineSet::line
ConstLineRef line(int index) const
Definition: SceneDrawables.h:688
cnoid::SgMesh::setPrimitive
void setPrimitive(Primitive prim)
Definition: SceneDrawables.h:464
cnoid::SgLineSet::addLine
LineRef addLine()
Definition: SceneDrawables.h:698
cnoid::SgPointSet::pointSize
double pointSize() const
Definition: SceneDrawables.h:647
cnoid::SgMaterial::setEmissiveColor
void setEmissiveColor(const Eigen::MatrixBase< Derived > &c)
Definition: SceneDrawables.h:30
cnoid::SgPlot::colorIndices
const SgIndexArray & colorIndices() const
Definition: SceneDrawables.h:605
cnoid::SgImage::constImage
const Image & constImage() const
Definition: SceneDrawables.h:76
cnoid::SgMesh::Capsule::radius
double radius
Definition: SceneDrawables.h:454
cnoid::SgNormalArrayPtr
ref_ptr< SgNormalArray > SgNormalArrayPtr
Definition: SceneDrawables.h:245
cnoid::SgMeshBase::texCoords_
SgTexCoordArrayPtr texCoords_
Definition: SceneDrawables.h:328
cnoid::SgMesh::Cylinder::height
double height
Definition: SceneDrawables.h:434
cnoid::SgMeshBase::hasNormalIndices
bool hasNormalIndices() const
Definition: SceneDrawables.h:302
cnoid::SgTextureTransform::setTranslation
void setTranslation(const Eigen::MatrixBase< Derived > &c)
Definition: SceneDrawables.h:118
cnoid::SgVectorArray::erase
iterator erase(iterator p)
Definition: SceneDrawables.h:229
cnoid::SgShapePtr
ref_ptr< SgShape > SgShapePtr
Definition: SceneDrawables.h:567
cnoid::SgMesh::setDivisionNumber
void setDivisionNumber(int n)
Definition: SceneDrawables.h:468
cnoid::SgTexture::repeatS
bool repeatS() const
Definition: SceneDrawables.h:149
cnoid::SgViewportOverlay::ViewVolume::zNear
double zNear
Definition: SceneDrawables.h:764
cnoid::SgMesh::PrimitiveType
PrimitiveType
Definition: SceneDrawables.h:397
cnoid::SgVectorArray::SgVectorArray
SgVectorArray(const SgVectorArray &org)
Definition: SceneDrawables.h:199
cnoid::SgImage::numComponents
int numComponents() const
Definition: SceneDrawables.h:86
cnoid::SgVectorArray::shrink_to_fit
void shrink_to_fit()
Definition: SceneDrawables.h:232
cnoid::SgVectorArray::reserve
void reserve(size_type s)
Definition: SceneDrawables.h:213
cnoid::SgMesh::ExtraDivisionMode
ExtraDivisionMode
This mode is only valid for the box primitive.
Definition: SceneDrawables.h:475
cnoid::SgVectorArray::const_pointer
Container::const_pointer const_pointer
Definition: SceneDrawables.h:183
cnoid::SgMesh::Capsule::Capsule
Capsule()
Definition: SceneDrawables.h:451
cnoid::SgImage::constPixels
const unsigned char * constPixels() const
Definition: SceneDrawables.h:82
cnoid::SgPlot::normals
const SgNormalArray * normals() const
Definition: SceneDrawables.h:617
cnoid::SgMeshBase::vertices
const SgVertexArray * vertices() const
Definition: SceneDrawables.h:274
cnoid::SgOverlay
Definition: SceneDrawables.h:737
cnoid::SgMesh::MeshType
@ MeshType
Definition: SceneDrawables.h:398
cnoid::SgPlot::vertices
const SgVertexArray * vertices() const
Definition: SceneDrawables.h:590
cnoid::SgLineSet::numLines
int numLines() const
Definition: SceneDrawables.h:677
cnoid::SgMeshBase::colorIndices
const SgIndexArray & colorIndices() const
Definition: SceneDrawables.h:307
cnoid::SgMeshBase::normals
SgNormalArray * normals()
Definition: SceneDrawables.h:279
cnoid::SgTexCoordArrayPtr
ref_ptr< SgTexCoordArray > SgTexCoordArrayPtr
Definition: SceneDrawables.h:251
cnoid::SgVectorArray::reference
Container::reference reference
Definition: SceneDrawables.h:180
cnoid::SgVectorArray::front
const T & front() const
Definition: SceneDrawables.h:220
cnoid::SgMeshBase::colors
SgColorArray * colors()
Definition: SceneDrawables.h:285
cnoid::SgPolygonMesh
Definition: SceneDrawables.h:503
cnoid::SgVectorArray::at
T & at(size_type i)
Definition: SceneDrawables.h:217
Image.h
cnoid::SgVectorArray::operator[]
const T & operator[](size_type i) const
Definition: SceneDrawables.h:216
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::SgLineSet::addLine
void addLine(int v0, int v1)
Definition: SceneDrawables.h:704
cnoid::SgVectorArray::end
iterator end()
Definition: SceneDrawables.h:207
cnoid::CloneMap
Definition: CloneMap.h:13
cnoid::SgNormalArray
SgVectorArray< Vector3f > SgNormalArray
Definition: SceneDrawables.h:244
cnoid::SgMesh::SphereType
@ SphereType
Definition: SceneDrawables.h:400
cnoid::SgLineSet::lineVertexIndices
SgIndexArray & lineVertexIndices()
Definition: SceneDrawables.h:667
cnoid::SgViewportOverlay::ViewVolume
Definition: SceneDrawables.h:759
cnoid::SgMeshBase::vertices
SgVertexArray * vertices()
Definition: SceneDrawables.h:273
cnoid::SgMesh::newTriangle
TriangleRef newTriangle()
Definition: SceneDrawables.h:373
cnoid::SgMesh::Capsule::Capsule
Capsule(double radius, double height)
Definition: SceneDrawables.h:452
cnoid::SgMesh::Mesh
Definition: SceneDrawables.h:414
cnoid::SgMeshBase::colorIndices
SgIndexArray & colorIndices()
Definition: SceneDrawables.h:308
cnoid::SgViewportOverlay::ViewVolume::top
double top
Definition: SceneDrawables.h:763
cnoid::SgVectorArray::Scalar
T::Scalar Scalar
Definition: SceneDrawables.h:184
cnoid::SgTextureTransform
Definition: SceneDrawables.h:101
cnoid::SgMeshBase::colors
const SgColorArray * colors() const
Definition: SceneDrawables.h:286
cnoid::SgPointSet
Definition: SceneDrawables.h:636
cnoid::SgLineSet::setLineColor
void setLineColor(int lineIndex, int colorIndex)
Definition: SceneDrawables.h:713
cnoid::SgMaterial::diffuseColor
const Vector3f & diffuseColor() const
Definition: SceneDrawables.h:26
cnoid::SgMesh::numTriangles
int numTriangles() const
Definition: SceneDrawables.h:352
cnoid::SgPlot::colors
SgColorArray * colors()
Definition: SceneDrawables.h:600
cnoid::SgViewportOverlay::ViewVolume::left
double left
Definition: SceneDrawables.h:760
cnoid::SgLineSet::line
LineRef line(int index)
Definition: SceneDrawables.h:683
cnoid::SgPlot::normalIndices
SgIndexArray & normalIndices()
Definition: SceneDrawables.h:621
cnoid::SgMesh::setExtraDivisionMode
void setExtraDivisionMode(int mode)
Definition: SceneDrawables.h:483
cnoid::SgMeshBase::texCoordIndices
SgIndexArray & texCoordIndices()
Definition: SceneDrawables.h:312
cnoid::SgVectorArray::value_type
Container::value_type value_type
Definition: SceneDrawables.h:179
cnoid::SgVectorArray::SgVectorArray
SgVectorArray(const std::vector< T > &org)
Definition: SceneDrawables.h:188
cnoid::SgVectorArray::SgVectorArray
SgVectorArray(size_t size)
Definition: SceneDrawables.h:187
cnoid::SgLineSet::setNumLines
void setNumLines(int n)
Definition: SceneDrawables.h:678
cnoid::SgViewportOverlayPtr
ref_ptr< SgViewportOverlay > SgViewportOverlayPtr
Definition: SceneDrawables.h:775
cnoid::SgTextureTransform::center
const Vector2 & center() const
Definition: SceneDrawables.h:109
cnoid::SgPlot::hasColors
bool hasColors() const
Definition: SceneDrawables.h:599
cnoid::SgMaterialPtr
ref_ptr< SgMaterial > SgMaterialPtr
Definition: SceneDrawables.h:63
cnoid::Referenced
Definition: Referenced.h:54
cnoid::SgMeshBase::hasVertices
bool hasVertices() const
Definition: SceneDrawables.h:272
cnoid::SgPlotPtr
ref_ptr< SgPlot > SgPlotPtr
Definition: SceneDrawables.h:633
cnoid::SgMesh::extraDivisionNumber
int extraDivisionNumber() const
The value is -1 when the extra division number is not explicitly specified.
Definition: SceneDrawables.h:471
cnoid::SgMeshBase::normalIndices
SgIndexArray & normalIndices()
Definition: SceneDrawables.h:304
cnoid::SgMesh::setTriangle
void setTriangle(int index, int v0, int v1, int v2)
Definition: SceneDrawables.h:366
cnoid::SgLineSet::LineRef
Eigen::Map< Array2i > LineRef
Definition: SceneDrawables.h:682
cnoid::SgMaterial::ambientIntensity
float ambientIntensity() const
Definition: SceneDrawables.h:24
cnoid::SgMesh::Sphere
Definition: SceneDrawables.h:422
cnoid::SgLineSet::resizeColorIndicesForNumLines
void resizeColorIndicesForNumLines(int n)
Definition: SceneDrawables.h:709
SceneGraph.h
cnoid::SgMeshBase
Definition: SceneDrawables.h:256
cnoid::SgMeshBasePtr
ref_ptr< SgMeshBase > SgMeshBasePtr
Definition: SceneDrawables.h:334
cnoid::SgMeshBase::texCoords
SgTexCoordArray * texCoords()
Definition: SceneDrawables.h:291
cnoid::SgViewportOverlay::ViewVolume::right
double right
Definition: SceneDrawables.h:761
cnoid::SgPlot::colorIndices
SgIndexArray & colorIndices()
Definition: SceneDrawables.h:606
cnoid::SgMeshBase::faceVertexIndices
const SgIndexArray & faceVertexIndices() const
Definition: SceneDrawables.h:297
cnoid::Image
Definition: Image.h:16
cnoid::SgViewportOverlay::ViewVolume::zFar
double zFar
Definition: SceneDrawables.h:765
cnoid::SgIndexArray
std::vector< int > SgIndexArray
Definition: SceneDrawables.h:253
cnoid::SgMeshBase::texCoords
const SgTexCoordArray * texCoords() const
Definition: SceneDrawables.h:292
cnoid::SgLineSet::lineWidth
float lineWidth() const
Definition: SceneDrawables.h:723
cnoid::SgImage::height
int height() const
Definition: SceneDrawables.h:85
cnoid::SgShape::material
SgMaterial * material()
Definition: SceneDrawables.h:547
cnoid::SgTextureTransform::scale
const Vector2 & scale() const
Definition: SceneDrawables.h:114
cnoid::SgShape
Definition: SceneDrawables.h:530
cnoid::SgMeshBase::texCoordIndices_
SgIndexArray texCoordIndices_
Definition: SceneDrawables.h:329
cnoid::SgImage::image
const Image & image() const
Definition: SceneDrawables.h:75
cnoid::SgLineSet::lineVertexIndices
const SgIndexArray & lineVertexIndices() const
Definition: SceneDrawables.h:666
cnoid::SgTexCoordArray
SgVectorArray< Vector2f, Eigen::aligned_allocator< Vector2f > > SgTexCoordArray
Definition: SceneDrawables.h:250
cnoid::SgVectorArray::at
const T & at(size_type i) const
Definition: SceneDrawables.h:218
cnoid::SgMeshBase::normalIndices_
SgIndexArray normalIndices_
Definition: SceneDrawables.h:325
cnoid::SgMeshBase::normals
const SgNormalArray * normals() const
Definition: SceneDrawables.h:280
cnoid::SgMesh::Box::Box
Box()
Definition: SceneDrawables.h:418
cnoid::SgMesh::Cylinder::bottom
bool bottom
Definition: SceneDrawables.h:436
cnoid::SgMeshBase::setSolid
void setSolid(bool on)
Definition: SceneDrawables.h:318
cnoid::SgMeshBase::faceVertexIndices_
SgIndexArray faceVertexIndices_
Definition: SceneDrawables.h:323
cnoid::SgMesh::TriangleRef
Eigen::Map< Array3i > TriangleRef
Definition: SceneDrawables.h:356
cnoid::SgVectorArray::push_back
void push_back(const T &v)
Definition: SceneDrawables.h:226
cnoid::SgOverlayPtr
ref_ptr< SgOverlay > SgOverlayPtr
Definition: SceneDrawables.h:749
cnoid::SgPlot::colors
const SgColorArray * colors() const
Definition: SceneDrawables.h:601
cnoid::SgVectorArray::back
T & back()
Definition: SceneDrawables.h:221
cnoid::SgMesh::Cone::side
bool side
Definition: SceneDrawables.h:447
cnoid::SgVectorArray::iterator
Container::iterator iterator
Definition: SceneDrawables.h:176
cnoid::SgObject
Definition: SceneGraph.h:28
cnoid::SgMesh::CapsuleType
@ CapsuleType
Definition: SceneDrawables.h:403
cnoid::SgMesh::BoxType
@ BoxType
Definition: SceneDrawables.h:399
cnoid::SgTexture::repeatT
bool repeatT() const
Definition: SceneDrawables.h:150
cnoid::SgMaterial::setDiffuseColor
void setDiffuseColor(const Eigen::MatrixBase< Derived > &c)
Definition: SceneDrawables.h:27
cnoid::SgShape::texture
const SgTexture * texture() const
Definition: SceneDrawables.h:553
cnoid::SgMeshBase::hasFaceVertexIndices
bool hasFaceVertexIndices() const
Definition: SceneDrawables.h:296
cnoid::SgViewportOverlay
Definition: SceneDrawables.h:752
cnoid::SgMeshBase::isSolid_
bool isSolid_
Definition: SceneDrawables.h:331
cnoid::SgMeshBase::hasColors
bool hasColors() const
Definition: SceneDrawables.h:284
cnoid::SgMesh::Cone
Definition: SceneDrawables.h:439
cnoid::SgMaterial
Definition: SceneDrawables.h:18
cnoid::SgMesh::CylinderType
@ CylinderType
Definition: SceneDrawables.h:401
cnoid::SgNode
Definition: SceneGraph.h:157
cnoid::SgVectorArray::doClone
virtual Referenced * doClone(CloneMap *) const override
Definition: SceneDrawables.h:235
cnoid::SgViewportOverlay::ViewVolume::bottom
double bottom
Definition: SceneDrawables.h:762
cnoid::SgMesh::triangleVertices
const SgIndexArray & triangleVertices() const
Definition: SceneDrawables.h:348
cnoid::SgTexture::image
SgImage * image()
Definition: SceneDrawables.h:144
cnoid::Affine3
Eigen::Affine3d Affine3
Definition: EigenTypes.h:62
cnoid::BoundingBox
Definition: BoundingBox.h:17
cnoid::SgPlot::normals
SgNormalArray * normals()
Definition: SceneDrawables.h:616
cnoid::SgVectorArray::resize
void resize(size_type s)
Definition: SceneDrawables.h:210
cnoid::SgLineSet::setLine
void setLine(int index, int v0, int v1)
Definition: SceneDrawables.h:692
cnoid::SgVectorArray::back
const T & back() const
Definition: SceneDrawables.h:222
cnoid::SgPlot::material
SgMaterial * material()
Definition: SceneDrawables.h:594
cnoid::SgMeshBase::hasColorIndices
bool hasColorIndices() const
Definition: SceneDrawables.h:306
cnoid::SgLineSet::setLineWidth
void setLineWidth(float width)
Definition: SceneDrawables.h:718
cnoid::SgPlot::vertices
SgVertexArray * vertices()
Definition: SceneDrawables.h:589
cnoid::SgVectorArray::data
const Scalar * data() const
Definition: SceneDrawables.h:224
cnoid::SgMesh::Cylinder::Cylinder
Cylinder(double radius, double height)
Definition: SceneDrawables.h:431
cnoid::SgVectorArray::capacity
size_type capacity() const
Definition: SceneDrawables.h:214
cnoid::SgTexture
Definition: SceneDrawables.h:134
cnoid::SgMesh::triangle
TriangleRef triangle(int index)
Definition: SceneDrawables.h:357
cnoid::SgVectorArray::pop_back
void pop_back()
Definition: SceneDrawables.h:228
cnoid::SgMesh::Cylinder::Cylinder
Cylinder()
Definition: SceneDrawables.h:430
cnoid::SgMesh::Cone::radius
double radius
Definition: SceneDrawables.h:444
cnoid::SgMesh::primitiveType
const int primitiveType() const
Definition: SceneDrawables.h:462
cnoid::SgVectorArray::begin
const_iterator begin() const
Definition: SceneDrawables.h:206
cnoid::SgMesh::Sphere::Sphere
Sphere()
Definition: SceneDrawables.h:424