예제 #1
0
/** Valued constructor
 *  @param n :: name of the assembly
 *  @param reference :: the parent Component
 *
 * 	If the reference is an object of class Component,
 *  normal parenting apply. If the reference object is
 *  an assembly itself, then in addition to parenting
 *  this is registered as a children of reference.
 */
ObjCompAssembly::ObjCompAssembly(const std::string &n, IComponent *reference)
    : ObjComponent(n, reference) {
  if (reference) {
    ICompAssembly *test = dynamic_cast<ICompAssembly *>(reference);
    if (test)
      test->add(this);
  }
}
예제 #2
0
/** Valued constructor
 *  @param n :: name of the assembly
 *  @param reference :: the parent Component
 *
 * 	If the reference is an object of class Component,
 *  normal parenting apply. If the reference object is
 *  an assembly itself, then in addition to parenting
 *  this is registered as a children of reference.
 */
CompAssembly::CompAssembly(const std::string &n, IComponent *reference)
    : Component(n, reference), m_children(), m_cachedBoundingBox(NULL) {
  if (reference) {
    ICompAssembly *test = dynamic_cast<ICompAssembly *>(reference);
    if (test) {
      test->add(this);
    }
  }
}