void String::cachedDeepCopy(const Object::csptr &_source, DeepCopyCacheType &cache) { String::csptr other = String::dynamicConstCast(_source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (_source?_source->getClassname():std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldDeepCopy( _source, cache ); m_value = other->m_value; }
void TransformationMatrix3D::cachedDeepCopy(const Object::csptr &_source, DeepCopyCacheType &cache) { TransformationMatrix3D::csptr other = TransformationMatrix3D::dynamicConstCast(_source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (_source?_source->getClassname():std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldDeepCopy( _source, cache ); m_vCoefficients = other->m_vCoefficients; }
void MultiFiles::cachedDeepCopy(const Object::csptr &source, DeepCopyCacheType &cache) { MultiFiles::csptr other = MultiFiles::dynamicConstCast(source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (source ? source->getClassname() : std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldDeepCopy( source, cache ); OSLM_FATAL("Not implemented." ); }
void Line::shallowCopy(const Object::csptr &_source ) { Line::csptr other = Line::dynamicConstCast(_source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (_source?_source->getClassname():std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldShallowCopy( _source ); m_position = other->m_position; m_direction = other->m_direction; }
void Graph::shallowCopy(const Object::csptr& _source ) { Graph::csptr other = Graph::dynamicConstCast(_source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldShallowCopy( _source ); m_nodes = other->m_nodes; m_connections = other->m_connections; }
void Tag::cachedDeepCopy(const Object::csptr &source, DeepCopyCacheType &cache) { Tag::csptr other = Tag::dynamicConstCast(source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (source?source->getClassname():std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldDeepCopy( source, cache ); m_sType = other->m_sType; m_size = other->m_size; m_pointList = ::fwData::Object::copy(other->m_pointList, cache); }
//------------------------------------------------------------------------------ void Edge::shallowCopy(const Object::csptr &_source ) { Edge::csptr other = Edge::dynamicConstCast(_source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldShallowCopy( _source ); m_fromPortIdentifier = other->m_fromPortIdentifier; m_toPortIdentifier = other->m_toPortIdentifier; m_nature = other->m_nature; }
void Image::shallowCopy(const Object::csptr& _source ) { Image::csptr other = Image::dynamicConstCast(_source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldShallowCopy( _source ); // Assign copyInformation( other ); m_dataArray = other->m_dataArray; }
void Image::cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache) { Image::csptr other = Image::dynamicConstCast(_source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldDeepCopy( _source, cache ); // Assign copyInformation( other ); if( other->m_dataArray ) { m_dataArray = ::fwData::Object::copy(other->m_dataArray, cache); } }
void PacsConfiguration::cachedDeepCopy(const Object::csptr &_source, DeepCopyCacheType &cache) { PacsConfiguration::csptr other = PacsConfiguration::dynamicConstCast(_source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (_source?_source->getClassname():std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldDeepCopy( _source, cache ); m_attrLocalApplicationTitle = other->m_attrLocalApplicationTitle; m_attrPacsHostName = other->m_attrPacsHostName; m_attrPacsApplicationTitle = other->m_attrPacsApplicationTitle; m_attrPacsApplicationPort = other->m_attrPacsApplicationPort; m_attrMoveApplicationTitle = other->m_attrMoveApplicationTitle; m_attrMoveApplicationPort = other->m_attrMoveApplicationPort; m_attrRetrieveMethod = other->m_attrRetrieveMethod; }
void Graph::cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache) { Graph::csptr other = Graph::dynamicConstCast(_source); FW_RAISE_EXCEPTION_IF( ::fwData::Exception( "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>")) + " to " + this->getClassname()), !bool(other) ); this->fieldDeepCopy( _source, cache ); std::map< ::fwData::Node::sptr, ::fwData::Node::sptr > correspondenceBetweenNodes; typedef std::pair< Edge::sptr, std::pair< Node::sptr, Node::sptr > > ConnectionContainerElt; m_nodes.clear(); for(const ::fwData::Node::sptr& node : other->m_nodes) { ::fwData::Node::sptr newNode = ::fwData::Object::copy(node, cache); bool addOK = this->addNode(newNode); OSLM_ASSERT("Node "<<newNode->getID() <<" can't be added ", addOK ); FwCoreNotUsedMacro(addOK); correspondenceBetweenNodes.insert(std::make_pair(node, newNode)); } m_connections.clear(); for(const ConnectionContainerElt& connection : other->m_connections) { // Edge deep copy . ::fwData::Edge::sptr newEdge = ::fwData::Object::copy(connection.first, cache); ::fwData::Node::sptr oldNode1 = (connection.second).first; ::fwData::Node::sptr oldNode2 = (connection.second).second; if ((correspondenceBetweenNodes.find(Node::constCast(oldNode1)) != correspondenceBetweenNodes.end()) && (correspondenceBetweenNodes.find(Node::constCast(oldNode2)) != correspondenceBetweenNodes.end())) { // Add new Edge this->addEdge(newEdge, correspondenceBetweenNodes[oldNode1], correspondenceBetweenNodes[oldNode2]); } } correspondenceBetweenNodes.clear(); }