ccPolyline::ccPolyline(GenericIndexedCloudPersist* associatedCloud) : Polyline(associatedCloud) , ccHObject("Polyline") { set2DMode(false); setForeground(true); setVisible(true); lockVisibility(false); }
ccPolyline::ccPolyline(const ccPolyline& poly) : Polyline(ccPointCloud::From(poly.getAssociatedCloud())) , ccHObject("Polyline") { set2DMode(poly.m_mode2D); setForeground(poly.m_foreground); setVisible(poly.isVisible()); lockVisibility(poly.isVisiblityLocked()); setColor(poly.m_rgbColor); }
bool ccPolyline::initWith(ccPointCloud*& vertices, const ccPolyline& poly) { bool success = true; if (!vertices) { ccPointCloud* cloud = dynamic_cast<ccPointCloud*>(poly.m_theAssociatedCloud); ccPointCloud* clone = cloud ? cloud->partialClone(&poly) : ccPointCloud::From(&poly); if (clone) { if (cloud) clone->setName(cloud->getName()); //as 'partialClone' adds the '.extract' suffix by default else clone->setGLTransformationHistory(poly.getGLTransformationHistory()); } else { //not enough memory? ccLog::Warning("[ccPolyline::initWith] Not enough memory to duplicate vertices!"); success = false; } vertices = clone; } if (vertices) { setAssociatedCloud(vertices); addChild(vertices); //vertices->setEnabled(false); assert(m_theAssociatedCloud); if (m_theAssociatedCloud) addPointIndex(0,m_theAssociatedCloud->size()); } setClosed(poly.m_isClosed); set2DMode(poly.m_mode2D); setForeground(poly.m_foreground); setVisible(poly.isVisible()); lockVisibility(poly.isVisiblityLocked()); setColor(poly.m_rgbColor); setWidth(poly.m_width); showColors(poly.colorsShown()); showVertices(poly.verticesShown()); setVertexMarkerWidth(poly.getVertexMarkerWidth()); setVisible(poly.isVisible()); showArrow(m_showArrow,m_arrowIndex,m_arrowLength); setGlobalScale(poly.getGlobalScale()); setGlobalShift(poly.getGlobalShift()); setGLTransformationHistory(poly.getGLTransformationHistory()); setMetaData(poly.metaData()); return success; }
ccPolyline::ccPolyline(GenericIndexedCloudPersist* associatedCloud) : Polyline(associatedCloud) , ccHObject("Polyline") { set2DMode(false); setForeground(true); setVisible(true); lockVisibility(false); setColor(ccColor::white); showVertices(false); setVertexMarkerWidth(3); setWidth(0); }
ccPolyline::ccPolyline(const ccPolyline& poly) : Polyline(ccPointCloud::From(poly.getAssociatedCloud())) , ccHObject("Polyline") { assert(m_theAssociatedCloud); if (m_theAssociatedCloud) addPointIndex(0,m_theAssociatedCloud->size()); setClosingState(poly.m_isClosed); set2DMode(poly.m_mode2D); setForeground(poly.m_foreground); setVisible(poly.isVisible()); lockVisibility(poly.isVisiblityLocked()); setColor(poly.m_rgbColor); }
void ccPolyline::importParametersFrom(const ccPolyline& poly) { setClosed(poly.m_isClosed); set2DMode(poly.m_mode2D); setForeground(poly.m_foreground); setVisible(poly.isVisible()); lockVisibility(poly.isVisiblityLocked()); setColor(poly.m_rgbColor); setWidth(poly.m_width); showColors(poly.colorsShown()); showVertices(poly.verticesShown()); setVertexMarkerWidth(poly.getVertexMarkerWidth()); setVisible(poly.isVisible()); showArrow(m_showArrow,m_arrowIndex,m_arrowLength); setGlobalScale(poly.getGlobalScale()); setGlobalShift(poly.getGlobalShift()); setGLTransformationHistory(poly.getGLTransformationHistory()); setMetaData(poly.metaData()); }
ccPolyline::ccPolyline(GenericIndexedCloudPersist* associatedCloud) : Polyline(associatedCloud) , ccShiftedObject("Polyline") { set2DMode(false); setForeground(true); setVisible(true); lockVisibility(false); setColor(ccColor::white); showVertices(false); setVertexMarkerWidth(3); setWidth(0); showArrow(false,0,0); ccGenericPointCloud* cloud = dynamic_cast<ccGenericPointCloud*>(associatedCloud); if (cloud) { setGlobalScale(cloud->getGlobalScale()); setGlobalShift(cloud->getGlobalShift()); } }