Choreonoid  1.8
SceneGraph.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_UTIL_SCENE_GRAPH_H
7 #define CNOID_UTIL_SCENE_GRAPH_H
8 
9 #include <cnoid/ClonableReferenced>
10 #include <cnoid/SceneUpdate>
11 #include <cnoid/BoundingBox>
12 #include <cnoid/Signal>
13 #include <string>
14 #include <vector>
15 #include <set>
16 #include <memory>
17 #include "exportdecl.h"
18 
19 namespace cnoid {
20 
21 class CloneMap;
22 class SgNode;
23 class SgGroup;
25 typedef std::vector<SgNode*> SgNodePath;
26 
27 
28 class CNOID_EXPORT SgObject : public ClonableReferenced
29 {
30 public:
31  typedef std::set<SgObject*> ParentContainer;
32  typedef ParentContainer::iterator parentIter;
33  typedef ParentContainer::const_iterator const_parentIter;
34 
35  SgObject* clone() const{
36  return static_cast<SgObject*>(doClone(nullptr));
37  }
38 
39  SgObject* clone(CloneMap& cloneMap) const{
40  return static_cast<SgObject*>(doClone(&cloneMap));
41  }
42 
43  static bool checkNonNodeCloning(const CloneMap& cloneMap);
44  static void setNonNodeCloning(CloneMap& cloneMap, bool on);
45 
46  enum Attribute {
47  Node = 1 << 0,
48  GroupNode = 1 << 1,
49  TransformNode = 1 << 2,
50  Composite = 1 << 3, // the object has some SgObject members other than group node children
51  Geometry = 1 << 4,
52  Appearance = 1 << 5,
53  NodeDecoration = 1 << 6,
54  Marker = 1 << 7,
55  Operable = 1 << 8,
56  MaxAttributeBit = 9,
57 
58  // deprecated
59  GroupAttribute = GroupNode,
60  NodeDecorationGroup = NodeDecoration,
61  MarkerAttribute = Marker
62  };
63 
64  void setAttribute(int attr){ attributes_ |= attr; }
65  void setAttributes(int attrs){ attributes_ |= attrs; }
66  int attributes() const { return attributes_; }
67  bool hasAttribute(int attr) const { return attributes_ & attr; }
68  bool hasAttributes(int attrs) const { return (attributes_ & attrs) == attrs; }
69 
70  const std::string& name() const { return name_; }
71  void setName(const std::string& name) { name_ = name; }
72 
73  virtual int numChildObjects() const;
74  virtual SgObject* childObject(int index);
75 
76  SignalProxy<void(const SgUpdate& update)> sigUpdated() {
77  return sigUpdated_;
78  }
79 
80  void notifyUpdate(SgUpdate& update) {
81  update.clearPath();
82  notifyUpperNodesOfUpdate(update);
83  }
84 
85  void notifyUpdate(int action = SgUpdate::Modified) {
86  SgUpdate update(action);
87  update.reservePathCapacity(16);
88  notifyUpperNodesOfUpdate(update);
89  }
90 
91  void addParent(SgObject* parent, SgUpdateRef update = nullptr);
92  void removeParent(SgObject* parent);
93  int numParents() const { return static_cast<int>(parents.size()); }
94  bool hasParents() const { return !parents.empty(); }
95 
96  const_parentIter parentBegin() const { return parents.begin(); }
97  const_parentIter parentEnd() const { return parents.end(); }
98 
103  SignalProxy<void(bool on)> sigGraphConnection() {
104  return sigGraphConnection_;
105  }
106 
107  bool hasValidBoundingBoxCache() const { return hasValidBoundingBoxCache_; }
108  void invalidateBoundingBox() { hasValidBoundingBoxCache_ = false; }
109  void setBoundingBoxCacheReady() const { hasValidBoundingBoxCache_ = true; }
110 
111  bool hasUri() const { return uriInfo && !uriInfo->uri.empty(); }
112  const std::string& uri() const;
113  bool hasAbsoluteUri() const { return uriInfo && !uriInfo->absoluteUri.empty(); }
114  const std::string& absoluteUri() const;
115  bool hasUriFragment() const { return uriInfo && !uriInfo->fragment.empty(); }
116  const std::string& uriFragment() const;
117  void setUriByFilePathAndBaseDirectory(const std::string& filePath, const std::string& baseDirectory);
118  void setUriByFilePathAndCurrentDirectory(const std::string& filePath);
119  void setUri(const std::string& uri, const std::string& absoluteUri);
120  void setUriFragment(const std::string& fragment);
121  void clearUri() { uriInfo.reset(); }
122 
123  bool isNode() const { return hasAttribute(Node); }
124  SgNode* toNode();
125  bool isGroupNode() const { return hasAttribute(GroupNode); }
126  SgGroup* toGroupNode();
127  bool isTransformNode() const { return hasAttribute(TransformNode); }
128  SgTransform* toTransformNode();
129 
130 protected:
131  SgObject();
132  SgObject(const SgObject& org);
133  virtual Referenced* doClone(CloneMap* cloneMap) const override;
134  void notifyUpperNodesOfUpdate(SgUpdate& update);
135  void notifyUpperNodesOfUpdate(SgUpdate& update, bool doInvalidateBoundingBox);
136 
137 private:
138  unsigned short attributes_;
139  mutable bool hasValidBoundingBoxCache_;
140  ParentContainer parents;
141  Signal<void(const SgUpdate& update)> sigUpdated_;
142  Signal<void(bool on)> sigGraphConnection_;
143  std::string name_;
144 
145  struct UriInfo {
146  std::string uri;
147  std::string absoluteUri;
148  std::string fragment;
149  };
150 
151  mutable std::unique_ptr<UriInfo> uriInfo;
152 };
153 
155 
156 
157 class CNOID_EXPORT SgNode : public SgObject
158 {
159 public:
160  SgNode();
161  SgNode(const SgNode& org);
162  ~SgNode();
163 
164  int classId() const { return classId_; }
165  static int findClassId(const std::type_info& nodeType);
166  template <class NodeType> static int findClassId() {
167  return findClassId(typeid(NodeType));
168  }
169 
170  SgNode* cloneNode() const {
171  return static_cast<SgNode*>(this->clone());
172  }
173  SgNode* cloneNode(CloneMap& cloneMap) const {
174  return static_cast<SgNode*>(this->clone(cloneMap));
175  }
176 
177  virtual const BoundingBox& boundingBox() const;
178  virtual const BoundingBox& untransformedBoundingBox() const;
179 
180  SgNodePath findNode(const std::string& name, Affine3& out_T);
181 
183  template <class NodeType, class SuperType>
184  struct registerType {
186  SgNode::registerNodeType(typeid(NodeType), typeid(SuperType));
187  }
188  };
189 
191  template <class NodeType> static int findPolymorphicId() {
192  return findClassId(typeid(NodeType));
193  }
194 
195  void addDecorationReference() { ++decorationRefCounter; }
196  void releaseDecorationReference() { --decorationRefCounter; }
197  bool isDecoratedSomewhere() const { return decorationRefCounter > 0; }
198 
199 protected:
200  SgNode(int classId);
201  virtual Referenced* doClone(CloneMap* cloneMap) const override;
202 
203 private:
204  int classId_;
205  int decorationRefCounter;
206 
208  static int registerNodeType(const std::type_info& nodeType, const std::type_info& superType);
209 };
210 
212 
213 
215 {
216  return isNode() ? static_cast<SgNode*>(this) : nullptr;
217 }
218 
219 
220 class CNOID_EXPORT SgGroup : public SgNode
221 {
222  typedef std::vector<SgNodePtr> Container;
223 
224 public:
225  typedef Container::iterator iterator;
226  typedef Container::reverse_iterator reverse_iterator;
227  typedef Container::const_iterator const_iterator;
228  typedef Container::const_reverse_iterator const_reverse_iterator;
229 
230  SgGroup();
231  SgGroup(const SgGroup& org, CloneMap* cloneMap = nullptr);
232  ~SgGroup();
233 
234  virtual int numChildObjects() const override;
235  virtual SgObject* childObject(int index) override;
236  virtual const BoundingBox& boundingBox() const override;
237 
238  iterator begin() { return children.begin(); }
239  iterator end() { return children.end(); }
240  const_iterator cbegin() { return children.cbegin(); }
241  const_iterator cend() { return children.cend(); }
242  reverse_iterator rbegin() { return children.rbegin(); }
243  reverse_iterator rend() { return children.rend(); }
244 
245  const_iterator begin() const { return children.begin(); }
246  const_iterator end() const { return children.end(); }
247  const_reverse_iterator rbegin() const { return children.rbegin(); }
248  const_reverse_iterator rend() const { return children.rend(); }
249 
250  iterator erase(iterator pos) { return children.erase(pos); }
251 
252  bool empty() const { return children.empty(); }
253  int numChildren() const { return static_cast<int>(children.size()); }
254  SgNode* child(int index) { return children[index]; }
255  const SgNode* child(int index) const { return children[index]; }
256  bool contains(SgNode* node) const;
257  int findChildIndex(SgNode* child) const;
258 
260  template<class NodeType> NodeType* getChild(int index) {
261  NodeType* node = dynamic_cast<NodeType*>(children.at(index).get());
262  if(!node) throwTypeMismatchError();
263  return node;
264  }
265 
266  void addChild(SgNode* node, SgUpdateRef update = nullptr);
267  bool addChildOnce(SgNode* node, SgUpdateRef update = nullptr);
268  void insertChild(int index, SgNode* node, SgUpdateRef update = nullptr);
269  void insertChild(SgNode* nextNode, SgNode* node, SgUpdateRef update = nullptr);
270  void setSingleChild(SgNode* node, SgUpdateRef update = nullptr);
271  iterator removeChild(iterator childIter, SgUpdateRef update = nullptr);
272  bool removeChild(SgNode* node, SgUpdateRef update = nullptr);
273  void removeChildAt(int index, SgUpdateRef update = nullptr);
274  void clearChildren(SgUpdateRef update = nullptr);
275  void copyChildrenTo(SgGroup* group, SgUpdateRef update = nullptr);
276  void moveChildrenTo(SgGroup* group, SgUpdateRef update = nullptr);
277 
278  [[deprecated("Use insertChild(int index, SgNode* node, SgUpdateRef update)")]]
279  void insertChild(SgNode* node, int index, SgUpdateRef update = nullptr){
280  insertChild(index, node, update);
281  }
282 
283  SgGroup* nextChainedGroup();
284  void insertChainedGroup(SgGroup* group, SgUpdateRef update = nullptr);
285  void removeChainedGroup(SgGroup* group, SgUpdateRef update = nullptr);
286 
287  template<class NodeType> NodeType* findNodeOfType(int depth = -1) {
288  for(int i=0; i < numChildren(); ++i){
289  if(NodeType* node = dynamic_cast<NodeType*>(child(i))) return node;
290  }
291  if(depth < 0 || --depth > 0){
292  for(int i=0; i < numChildren(); ++i){
293  auto child_ = child(i);
294  if(child_->isGroupNode()){
295  if(NodeType* node = static_cast<SgGroup*>(child_)->findNodeOfType<NodeType>(depth)){
296  return node;
297  }
298  }
299  }
300  }
301  return nullptr;
302  }
303 
304 protected:
305  SgGroup(int classId);
306  virtual Referenced* doClone(CloneMap* cloneMap) const override;
308 
309 private:
310  Container children;
311  static void throwTypeMismatchError();
312 };
313 
315 
316 
318 {
319  return isGroupNode() ? static_cast<SgGroup*>(this) : nullptr;
320 }
321 
322 
323 class CNOID_EXPORT SgInvariantGroup : public SgGroup
324 {
325 public:
327  SgInvariantGroup(const SgInvariantGroup& org, CloneMap* cloneMap = nullptr);
328 
329 protected:
330  virtual Referenced* doClone(CloneMap* cloneMap) const override;
331 };
332 
334 
335 
336 class CNOID_EXPORT SgTransform : public SgGroup
337 {
338 public:
339  virtual void getTransform(Affine3& out_T) const = 0;
340  virtual const BoundingBox& untransformedBoundingBox() const override;
341 
342 protected:
343  SgTransform(int classId);
344  SgTransform(const SgTransform& org, CloneMap* cloneMap = nullptr);
346 };
347 
349 
350 
352 {
353  return isTransformNode() ? static_cast<SgTransform*>(this) : nullptr;
354 }
355 
356 
357 class CNOID_EXPORT SgPosTransform : public SgTransform
358 {
359 public:
360  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
361 
362  SgPosTransform();
363  SgPosTransform(const Isometry3& T);
364  [[deprecated("Use SgPosTransform(const Isometry3& T)")]]
365  SgPosTransform(const Affine3& T);
366  SgPosTransform(const SgPosTransform& org, CloneMap* cloneMap = nullptr);
367 
368  virtual const BoundingBox& boundingBox() const override;
369  virtual void getTransform(Affine3& out_T) const override;
370 
371  Isometry3& T() { return T_; }
372  const Isometry3& T() const { return T_; }
373 
374  Isometry3& position() { return T_; }
375  const Isometry3& position() const { return T_; }
376 
377  Isometry3::TranslationPart translation() { return T_.translation(); }
378  Isometry3::ConstTranslationPart translation() const { return T_.translation(); }
379 
380  Isometry3::LinearPart rotation() { return T_.linear(); }
381  Isometry3::ConstLinearPart rotation() const { return T_.linear(); }
382 
383  template<class Scalar, int Mode, int Options>
384  void setPosition(const Eigen::Transform<Scalar, 3, Mode, Options>& T) {
385  T_ = T.template cast<Isometry3::Scalar>();
386  }
387  template<class Derived>
388  void setPosition(const Eigen::MatrixBase<Derived>& T){
389  T_ = T.template cast<Isometry3::Scalar>();
390  }
391  template<class Scalar, int Mode, int Options>
392  void setTransform(const Eigen::Transform<Scalar, 3, Mode, Options>& T) {
393  T_ = T.template cast<Isometry3::Scalar>();
394  }
395  template<typename Derived>
396  void setRotation(const Eigen::MatrixBase<Derived>& R) {
397  T_.linear() = R.template cast<Isometry3::Scalar>();
398  }
399  template<typename T>
400  void setRotation(const Eigen::AngleAxis<T>& aa) {
401  T_.linear() = aa.template cast<Isometry3::Scalar>().toRotationMatrix();
402  }
403  template<typename T>
404  void setRotation(const Eigen::Quaternion<T>& q) {
405  T_.linear() = q.template cast<Isometry3::Scalar>().toRotationMatrix();
406  }
407  template<typename Derived>
408  void setTranslation(const Eigen::MatrixBase<Derived>& p) {
409  T_.translation() = p.template cast<Isometry3::Scalar>();
410  }
411 
412 protected:
413  SgPosTransform(int classId);
414  virtual Referenced* doClone(CloneMap* cloneMap) const override;
415 
416 private:
417  Isometry3 T_;
418 };
419 
421 
422 
423 class CNOID_EXPORT SgScaleTransform : public SgTransform
424 {
425 public:
427  SgScaleTransform(double scale);
428  SgScaleTransform(const Vector3& scale);
429  SgScaleTransform(const SgScaleTransform& org, CloneMap* cloneMap);
430  virtual const BoundingBox& boundingBox() const override;
431  virtual void getTransform(Affine3& out_T) const override;
432 
433  const Vector3& scale() const { return scale_; }
434  Vector3& scale() { return scale_; }
435  template<typename Derived>
436  void setScale(const Eigen::MatrixBase<Derived>& s) {
437  scale_ = s.template cast<Vector3::Scalar>();
438  }
439  void setScale(double s){
440  scale_.setConstant(s);
441  }
442 
443  Eigen::DiagonalWrapper<const Vector3> T() const { return scale_.asDiagonal(); }
444 
445 protected:
446  SgScaleTransform(int classId);
447  virtual Referenced* doClone(CloneMap* cloneMap) const override;
448 
449 private:
450  Vector3 scale_;
451 };
452 
454 
455 
456 class CNOID_EXPORT SgAffineTransform : public SgTransform
457 {
458 public:
459  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
460 
462  SgAffineTransform(const Affine3& T);
463  SgAffineTransform(const SgAffineTransform& org, CloneMap* cloneMap = nullptr);
464 
465  virtual const BoundingBox& boundingBox() const override;
466  virtual void getTransform(Affine3& out_T) const override;
467 
468  Affine3& T() { return T_; }
469  const Affine3& T() const { return T_; }
470 
471  Affine3& transform() { return T_; }
472  const Affine3& transform() const { return T_; }
473 
474  template<class Scalar, int Mode, int Options>
475  void setTransform(const Eigen::Transform<Scalar, 3, Mode, Options>& T) {
476  T_ = T.template cast<Affine3::Scalar>();
477  }
478 
479  Affine3::TranslationPart translation() { return T_.translation(); }
480  Affine3::ConstTranslationPart translation() const { return T_.translation(); }
481 
482  Affine3::LinearPart linear() { return T_.linear(); }
483  Affine3::ConstLinearPart linear() const { return T_.linear(); }
484 
485  template<typename Derived>
486  void setLinear(const Eigen::MatrixBase<Derived>& M) {
487  T_.linear() = M.template cast<Affine3::Scalar>();
488  }
489  template<typename T>
490  void setLinear(const Eigen::AngleAxis<T>& aa) {
491  T_.linear() = aa.template cast<Affine3::Scalar>().toRotationMatrix();
492  }
493  template<typename Derived>
494  void setTranslation(const Eigen::MatrixBase<Derived>& p) {
495  T_.translation() = p.template cast<Affine3::Scalar>();
496  }
497 
498 protected:
499  SgAffineTransform(int classId);
500  virtual Referenced* doClone(CloneMap* cloneMap) const override;
501 
502 private:
503  Affine3 T_;
504 };
505 
507 
508 
509 class CNOID_EXPORT SgFixedPixelSizeGroup : public SgGroup
510 {
511 public:
513  SgFixedPixelSizeGroup(double pixelSizeRatio);
514  SgFixedPixelSizeGroup(const SgFixedPixelSizeGroup& org, CloneMap* cloneMap = nullptr);
515 
516  void setPixelSizeRatio(float ratio){ pixelSizeRatio_ = ratio; }
517  float pixelSizeRatio() const { return pixelSizeRatio_; }
518 
519 protected:
520  SgFixedPixelSizeGroup(int classId);
521  virtual Referenced* doClone(CloneMap* cloneMap) const override;
522 
523 private:
524  float pixelSizeRatio_;
525 };
526 
528 
529 
530 class CNOID_EXPORT SgSwitch : public SgObject
531 {
532 public:
533  SgSwitch(bool on = true);
534  SgSwitch(const SgSwitch& org);
535 
536  void setTurnedOn(bool on, SgUpdateRef update = nullptr);
537  bool isTurnedOn() const { return isTurnedOn_; }
538 
539 protected:
540  virtual Referenced* doClone(CloneMap* cloneMap) const override;
541 
542 private:
543  bool isTurnedOn_;
544 };
545 
547 
548 
549 class CNOID_EXPORT SgSwitchableGroup : public SgGroup
550 {
551 public:
553  SgSwitchableGroup(SgSwitch* switchObject);
554  SgSwitchableGroup(const SgSwitchableGroup& org, CloneMap* cloneMap = nullptr);
556 
557  void setSwitch(SgSwitch* newSwitchObject);
558 
559  void setTurnedOn(bool on, SgUpdateRef update = nullptr);
560 
561  bool isTurnedOn() const {
562  return switchObject ? switchObject->isTurnedOn() : isTurnedOn_;
563  }
564 
565  [[deprecated("Use the setTurnedOn function.")]]
566  void turnOn(bool doNotify = false) { setTurnedOn(true, doNotify); }
567  [[deprecated("Use the setTurnedOn function.")]]
568  void turnOff(bool doNotify = false) { setTurnedOn(false, doNotify); }
569 
570 protected:
571  virtual Referenced* doClone(CloneMap* cloneMap) const override;
572 
573 private:
574  SgSwitchPtr switchObject;
575  bool isTurnedOn_;
576 };
577 
579 
580 
581 class CNOID_EXPORT SgUnpickableGroup : public SgGroup
582 {
583 public:
585  SgUnpickableGroup(const SgUnpickableGroup& org, CloneMap* cloneMap = nullptr);
586 
587 protected:
588  virtual Referenced* doClone(CloneMap* cloneMap) const override;
589 
590 };
591 
593 
594 
595 class CNOID_EXPORT SgPreprocessed : public SgNode
596 {
597 protected:
598  SgPreprocessed(int classId);
599  SgPreprocessed(const SgPreprocessed& org);
600 };
601 
603 
604 
605 class SgMaterial;
606 class SgImage;
607 class SgTextureTransform;
608 class SgTexture;
609 class SgMesh;
610 class SgPolygonMesh;
611 class SgShape;
612 class SgPlot;
613 class SgPointSet;
614 class SgLineSet;
615 class SgOverlay;
616 class SgViewportOverlay;
617 class SgLight;
618 class SgDirectionalLight;
619 class SgPointLight;
620 class SgSpotLight;
621 class SgCamera;
622 class SgPerspectiveCamera;
624 class SgFog;
625 class SgOutline;
627 
628 }
629 
630 #endif
cnoid::SgScaleTransform::scale
const Vector3 & scale() const
Definition: SceneGraph.h:433
cnoid::SgScaleTransformPtr
ref_ptr< SgScaleTransform > SgScaleTransformPtr
Definition: SceneGraph.h:453
cnoid::SgImage
Definition: SceneDrawables.h:66
cnoid::SgPosTransform::setPosition
void setPosition(const Eigen::Transform< Scalar, 3, Mode, Options > &T)
Definition: SceneGraph.h:384
cnoid::SgObject::hasUri
bool hasUri() const
Definition: SceneGraph.h:111
cnoid::SgNode::isDecoratedSomewhere
bool isDecoratedSomewhere() const
Definition: SceneGraph.h:197
cnoid::SgPosTransform::rotation
Isometry3::ConstLinearPart rotation() const
Definition: SceneGraph.h:381
cnoid::SgAffineTransform::linear
Affine3::LinearPart linear()
Definition: SceneGraph.h:482
cnoid::SgPosTransform::setRotation
void setRotation(const Eigen::MatrixBase< Derived > &R)
Definition: SceneGraph.h:396
cnoid::SgObject::hasValidBoundingBoxCache
bool hasValidBoundingBoxCache() const
Definition: SceneGraph.h:107
cnoid::SgPosTransform::setRotation
void setRotation(const Eigen::Quaternion< T > &q)
Definition: SceneGraph.h:404
cnoid::SgGroup::cbegin
const_iterator cbegin()
Definition: SceneGraph.h:240
cnoid::SgGroup::rend
reverse_iterator rend()
Definition: SceneGraph.h:243
cnoid::SgObject::clone
SgObject * clone(CloneMap &cloneMap) const
Definition: SceneGraph.h:39
cnoid::SgObject::sigGraphConnection
SignalProxy< void(bool on)> sigGraphConnection()
Definition: SceneGraph.h:103
cnoid::SgPosTransform
Definition: SceneGraph.h:357
cnoid::SgObject::invalidateBoundingBox
void invalidateBoundingBox()
Definition: SceneGraph.h:108
cnoid::SgTransform
Definition: SceneGraph.h:336
cnoid::SgAffineTransform::setLinear
void setLinear(const Eigen::MatrixBase< Derived > &M)
Definition: SceneGraph.h:486
cnoid::Vector3
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
cnoid::SgSwitchableGroup::turnOff
void turnOff(bool doNotify=false)
Definition: SceneGraph.h:568
cnoid::SgObject::const_parentIter
ParentContainer::const_iterator const_parentIter
Definition: SceneGraph.h:33
cnoid::SgPerspectiveCamera
Definition: SceneCameras.h:56
cnoid::SgMesh
Definition: SceneDrawables.h:337
cnoid::SgInvariantGroupPtr
ref_ptr< SgInvariantGroup > SgInvariantGroupPtr
Definition: SceneGraph.h:333
cnoid::SgGroup::getChild
NodeType * getChild(int index)
This throws an exeption when the index is invalid or the type is not matched.
Definition: SceneGraph.h:260
cnoid::SgGroup::findNodeOfType
NodeType * findNodeOfType(int depth=-1)
Definition: SceneGraph.h:287
cnoid::SgFixedPixelSizeGroup
Definition: SceneGraph.h:509
cnoid::SgObject::parentEnd
const_parentIter parentEnd() const
Definition: SceneGraph.h:97
cnoid::SgNode::cloneNode
SgNode * cloneNode() const
Definition: SceneGraph.h:170
cnoid::SgUpdate::reservePathCapacity
void reservePathCapacity(int n)
Definition: SceneUpdate.h:37
cnoid::SgTransformPtr
ref_ptr< SgTransform > SgTransformPtr
Definition: SceneGraph.h:348
cnoid::SgPlot
Definition: SceneDrawables.h:570
cnoid::SgPosTransform::T
Isometry3 & T()
Definition: SceneGraph.h:371
cnoid::SgGroup
Definition: SceneGraph.h:220
cnoid::SgObject::toTransformNode
SgTransform * toTransformNode()
Definition: SceneGraph.h:351
cnoid::SgGroup::rbegin
reverse_iterator rbegin()
Definition: SceneGraph.h:242
cnoid::SgSwitchableGroup
Definition: SceneGraph.h:549
cnoid::SgScaleTransform
Definition: SceneGraph.h:423
cnoid::Isometry3
Eigen::Isometry3d Isometry3
Definition: EigenTypes.h:73
cnoid::SgGroup::const_iterator
Container::const_iterator const_iterator
Definition: SceneGraph.h:227
cnoid::SgLineSet
Definition: SceneDrawables.h:660
cnoid::SgPosTransform::setTransform
void setTransform(const Eigen::Transform< Scalar, 3, Mode, Options > &T)
Definition: SceneGraph.h:392
cnoid::SgCamera
Definition: SceneCameras.h:14
cnoid::SgPosTransform::translation
Isometry3::ConstTranslationPart translation() const
Definition: SceneGraph.h:378
cnoid::SgNode::findPolymorphicId
static int findPolymorphicId()
Definition: SceneGraph.h:191
cnoid::SgObject::Attribute
Attribute
Definition: SceneGraph.h:46
cnoid::SgObject::attributes
int attributes() const
Definition: SceneGraph.h:66
cnoid::SgPosTransform::setRotation
void setRotation(const Eigen::AngleAxis< T > &aa)
Definition: SceneGraph.h:400
cnoid::SgObject::notifyUpdate
void notifyUpdate(int action=SgUpdate::Modified)
Definition: SceneGraph.h:85
cnoid::SgPreprocessed
Definition: SceneGraph.h:595
cnoid::SgSpotLight
Definition: SceneLights.h:90
cnoid::SgObject::clone
SgObject * clone() const
Definition: SceneGraph.h:35
cnoid::SgNode::addDecorationReference
void addDecorationReference()
Definition: SceneGraph.h:195
cnoid::SgAffineTransform::T
const Affine3 & T() const
Definition: SceneGraph.h:469
cnoid::SgPreprocessedPtr
ref_ptr< SgPreprocessed > SgPreprocessedPtr
Definition: SceneGraph.h:602
cnoid::SgLight
Definition: SceneLights.h:14
cnoid::SgObject::toGroupNode
SgGroup * toGroupNode()
Definition: SceneGraph.h:317
cnoid::SgObject::ParentContainer
std::set< SgObject * > ParentContainer
Definition: SceneGraph.h:31
cnoid::SgGroup::const_reverse_iterator
Container::const_reverse_iterator const_reverse_iterator
Definition: SceneGraph.h:228
cnoid::SgUpdate
Definition: SceneUpdate.h:10
cnoid::SgAffineTransform::translation
Affine3::ConstTranslationPart translation() const
Definition: SceneGraph.h:480
cnoid::SgGroup::bboxCache
BoundingBox bboxCache
Definition: SceneGraph.h:307
cnoid::SgPosTransform::position
const Isometry3 & position() const
Definition: SceneGraph.h:375
cnoid::SgUpdateRef
Definition: SceneUpdate.h:73
cnoid::SgGroup::reverse_iterator
Container::reverse_iterator reverse_iterator
Definition: SceneGraph.h:226
cnoid::SgNode::classId
int classId() const
Definition: SceneGraph.h:164
cnoid::SgScaleTransform::T
Eigen::DiagonalWrapper< const Vector3 > T() const
Definition: SceneGraph.h:443
cnoid::SgObject::parentBegin
const_parentIter parentBegin() const
Definition: SceneGraph.h:96
cnoid::SgUnpickableGroup
Definition: SceneGraph.h:581
cnoid::ref_ptr
Definition: Referenced.h:103
cnoid::SgObject::hasParents
bool hasParents() const
Definition: SceneGraph.h:94
cnoid::SgGroup::insertChild
void insertChild(SgNode *node, int index, SgUpdateRef update=nullptr)
Definition: SceneGraph.h:279
cnoid::SgNode::registerType::registerType
registerType()
Definition: SceneGraph.h:185
cnoid::SgFixedPixelSizeGroup::setPixelSizeRatio
void setPixelSizeRatio(float ratio)
Definition: SceneGraph.h:516
cnoid::SgNode::releaseDecorationReference
void releaseDecorationReference()
Definition: SceneGraph.h:196
cnoid::SgObject::setName
void setName(const std::string &name)
Definition: SceneGraph.h:71
cnoid::SgGroup::cend
const_iterator cend()
Definition: SceneGraph.h:241
cnoid::SgGroup::end
iterator end()
Definition: SceneGraph.h:239
cnoid::SgInvariantGroup
Definition: SceneGraph.h:323
cnoid::SgOverlay
Definition: SceneDrawables.h:737
cnoid::SgPosTransform::setTranslation
void setTranslation(const Eigen::MatrixBase< Derived > &p)
Definition: SceneGraph.h:408
cnoid::SgOutline
Definition: SceneEffects.h:149
cnoid::SgGroup::erase
iterator erase(iterator pos)
Definition: SceneGraph.h:250
cnoid::SgObject::isTransformNode
bool isTransformNode() const
Definition: SceneGraph.h:127
cnoid::SgObject::isNode
bool isNode() const
Definition: SceneGraph.h:123
cnoid::SgFog
Definition: SceneEffects.h:69
cnoid::SgGroup::child
const SgNode * child(int index) const
Definition: SceneGraph.h:255
cnoid::SgPosTransform::translation
Isometry3::TranslationPart translation()
Definition: SceneGraph.h:377
cnoid::SgPolygonMesh
Definition: SceneDrawables.h:503
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::SgPosTransformPtr
ref_ptr< SgPosTransform > SgPosTransformPtr
Definition: SceneGraph.h:420
cnoid::SgDirectionalLight
Definition: SceneLights.h:43
cnoid::SgNodePtr
ref_ptr< SgNode > SgNodePtr
Definition: SceneGraph.h:211
cnoid::SgObject::name
const std::string & name() const
Definition: SceneGraph.h:70
cnoid::ClonableReferenced
Definition: ClonableReferenced.h:10
cnoid::SgPosTransform::position
Isometry3 & position()
Definition: SceneGraph.h:374
cnoid::CloneMap
Definition: CloneMap.h:13
cnoid::SgAffineTransform::setLinear
void setLinear(const Eigen::AngleAxis< T > &aa)
Definition: SceneGraph.h:490
cnoid::SgAffineTransform::transform
const Affine3 & transform() const
Definition: SceneGraph.h:472
cnoid::SgObject::numParents
int numParents() const
Definition: SceneGraph.h:93
cnoid::SgTextureTransform
Definition: SceneDrawables.h:101
cnoid::SgAffineTransform::setTransform
void setTransform(const Eigen::Transform< Scalar, 3, Mode, Options > &T)
Definition: SceneGraph.h:475
cnoid::SgPosTransform::setPosition
void setPosition(const Eigen::MatrixBase< Derived > &T)
Definition: SceneGraph.h:388
cnoid::SgAffineTransform::T
Affine3 & T()
Definition: SceneGraph.h:468
cnoid::SgLightweightRenderingGroup
Definition: SceneEffects.h:173
cnoid::SgPointSet
Definition: SceneDrawables.h:636
cnoid::SgNode::cloneNode
SgNode * cloneNode(CloneMap &cloneMap) const
Definition: SceneGraph.h:173
cnoid::SgObject::notifyUpdate
void notifyUpdate(SgUpdate &update)
Definition: SceneGraph.h:80
cnoid::SgUnpickableGroupPtr
ref_ptr< SgUnpickableGroup > SgUnpickableGroupPtr
Definition: SceneGraph.h:592
cnoid::SgGroup::empty
bool empty() const
Definition: SceneGraph.h:252
cnoid::SgObjectPtr
ref_ptr< SgObject > SgObjectPtr
Definition: SceneGraph.h:154
cnoid::SgUpdate::clearPath
void clearPath()
Definition: SceneUpdate.h:46
cnoid::SgSwitchableGroup::turnOn
void turnOn(bool doNotify=false)
Definition: SceneGraph.h:566
cnoid::SgObject::setAttribute
void setAttribute(int attr)
Definition: SceneGraph.h:64
cnoid::SgGroup::begin
iterator begin()
Definition: SceneGraph.h:238
cnoid::SgFixedPixelSizeGroup::pixelSizeRatio
float pixelSizeRatio() const
Definition: SceneGraph.h:517
cnoid::SgSwitchableGroup::isTurnedOn
bool isTurnedOn() const
Definition: SceneGraph.h:561
cnoid::SgAffineTransformPtr
ref_ptr< SgAffineTransform > SgAffineTransformPtr
Definition: SceneGraph.h:506
cnoid::SgNode::findClassId
static int findClassId()
Definition: SceneGraph.h:166
cnoid::SgScaleTransform::setScale
void setScale(double s)
Definition: SceneGraph.h:439
cnoid::SgGroup::end
const_iterator end() const
Definition: SceneGraph.h:246
cnoid::SgAffineTransform::setTranslation
void setTranslation(const Eigen::MatrixBase< Derived > &p)
Definition: SceneGraph.h:494
cnoid::SgAffineTransform
Definition: SceneGraph.h:456
cnoid::SgSwitch
Definition: SceneGraph.h:530
cnoid::Referenced
Definition: Referenced.h:54
cnoid::SgGroup::iterator
Container::iterator iterator
Definition: SceneGraph.h:225
cnoid::SgNode::registerType
Definition: SceneGraph.h:184
cnoid::SgGroup::numChildren
int numChildren() const
Definition: SceneGraph.h:253
cnoid::SgObject::sigUpdated
SignalProxy< void(const SgUpdate &update)> sigUpdated()
Definition: SceneGraph.h:76
cnoid::SgAffineTransform::transform
Affine3 & transform()
Definition: SceneGraph.h:471
cnoid::SgScaleTransform::setScale
void setScale(const Eigen::MatrixBase< Derived > &s)
Definition: SceneGraph.h:436
cnoid::SgUpdate::Modified
@ Modified
Definition: SceneUpdate.h:19
cnoid::SgObject::setBoundingBoxCacheReady
void setBoundingBoxCacheReady() const
Definition: SceneGraph.h:109
cnoid::SgPosTransform::T
const Isometry3 & T() const
Definition: SceneGraph.h:372
cnoid::SgNodePath
std::vector< SgNode * > SgNodePath
Definition: SceneGraph.h:24
cnoid::SgTransform::untransformedBboxCache
BoundingBox untransformedBboxCache
Definition: SceneGraph.h:345
cnoid::SgShape
Definition: SceneDrawables.h:530
cnoid::SgObject::toNode
SgNode * toNode()
Definition: SceneGraph.h:214
cnoid::SgGroup::child
SgNode * child(int index)
Definition: SceneGraph.h:254
cnoid::SgPosTransform::rotation
Isometry3::LinearPart rotation()
Definition: SceneGraph.h:380
cnoid::Signal
Definition: Signal.h:165
cnoid::SgGroup::rbegin
const_reverse_iterator rbegin() const
Definition: SceneGraph.h:247
cnoid::SgSwitchableGroupPtr
ref_ptr< SgSwitchableGroup > SgSwitchableGroupPtr
Definition: SceneGraph.h:578
cnoid::SignalProxy
Definition: Signal.h:470
cnoid::SgAffineTransform::linear
Affine3::ConstLinearPart linear() const
Definition: SceneGraph.h:483
cnoid::SgObject
Definition: SceneGraph.h:28
cnoid::SgGroupPtr
ref_ptr< SgGroup > SgGroupPtr
Definition: SceneGraph.h:314
cnoid::SgObject::setAttributes
void setAttributes(int attrs)
Definition: SceneGraph.h:65
cnoid::SgObject::hasAttributes
bool hasAttributes(int attrs) const
Definition: SceneGraph.h:68
cnoid::SgSwitchPtr
ref_ptr< SgSwitch > SgSwitchPtr
Definition: SceneGraph.h:546
cnoid::SgObject::parentIter
ParentContainer::iterator parentIter
Definition: SceneGraph.h:32
cnoid::SgViewportOverlay
Definition: SceneDrawables.h:752
cnoid::SgMaterial
Definition: SceneDrawables.h:18
cnoid::SgNode
Definition: SceneGraph.h:157
cnoid::SgFixedPixelSizeGroupPtr
ref_ptr< SgFixedPixelSizeGroup > SgFixedPixelSizeGroupPtr
Definition: SceneGraph.h:527
cnoid::SgOrthographicCamera
Definition: SceneCameras.h:83
cnoid::SgObject::clearUri
void clearUri()
Definition: SceneGraph.h:121
cnoid::Affine3
Eigen::Affine3d Affine3
Definition: EigenTypes.h:62
cnoid::BoundingBox
Definition: BoundingBox.h:17
cnoid::SgAffineTransform::translation
Affine3::TranslationPart translation()
Definition: SceneGraph.h:479
cnoid::SgPointLight
Definition: SceneLights.h:63
cnoid::SgObject::hasUriFragment
bool hasUriFragment() const
Definition: SceneGraph.h:115
cnoid::SgScaleTransform::scale
Vector3 & scale()
Definition: SceneGraph.h:434
cnoid::SgGroup::rend
const_reverse_iterator rend() const
Definition: SceneGraph.h:248
cnoid::SgObject::isGroupNode
bool isGroupNode() const
Definition: SceneGraph.h:125
cnoid::SgTexture
Definition: SceneDrawables.h:134
cnoid::SgObject::hasAttribute
bool hasAttribute(int attr) const
Definition: SceneGraph.h:67
cnoid::SgSwitch::isTurnedOn
bool isTurnedOn() const
Definition: SceneGraph.h:537
cnoid::SgObject::hasAbsoluteUri
bool hasAbsoluteUri() const
Definition: SceneGraph.h:113
cnoid::SgGroup::begin
const_iterator begin() const
Definition: SceneGraph.h:245