|
8 | 8 | #include "Geom/EntityFactory.h" |
9 | 9 | #include "Geom/OCCHelper.h" |
10 | 10 | #include "Geom/GeomProjectImplementation.h" |
11 | | -#include "Topo/CoEdge.h" |
12 | | -#include "Topo/Vertex.h" |
13 | 11 | #include "Group/Group1D.h" |
14 | 12 | /*----------------------------------------------------------------------------*/ |
15 | 13 | #include <TkUtil/MemoryError.h> |
@@ -115,32 +113,6 @@ bool Curve::isEqual(Geom::Curve* curve) |
115 | 113 | return true; |
116 | 114 | } |
117 | 115 | /*----------------------------------------------------------------------------*/ |
118 | | -void Curve::get(std::vector<Topo::CoEdge*>& coedges) |
119 | | -{ |
120 | | - const std::vector<Topo::TopoEntity* >& topos = getRefTopo(); |
121 | | - |
122 | | - for (std::vector<Topo::TopoEntity* >::const_iterator iter = topos.begin(); |
123 | | - iter != topos.end(); ++iter) |
124 | | - if ((*iter)->getDim() == 1){ |
125 | | - Topo::CoEdge* coedge = dynamic_cast<Topo::CoEdge*>(*iter); |
126 | | - if (coedge) |
127 | | - coedges.push_back(coedge); |
128 | | - } |
129 | | -} |
130 | | -/*----------------------------------------------------------------------------*/ |
131 | | -void Curve::get(std::vector<Topo::Vertex*>& vertices) |
132 | | -{ |
133 | | - const std::vector<Topo::TopoEntity* >& topos = getRefTopo(); |
134 | | - |
135 | | - for (std::vector<Topo::TopoEntity* >::const_iterator iter = topos.begin(); |
136 | | - iter != topos.end(); ++iter) |
137 | | - if ((*iter)->getDim() == 0){ |
138 | | - Topo::Vertex* vertex = dynamic_cast<Topo::Vertex*>(*iter); |
139 | | - if (vertex) |
140 | | - vertices.push_back(vertex); |
141 | | - } |
142 | | -} |
143 | | -/*----------------------------------------------------------------------------*/ |
144 | 116 | void Curve:: |
145 | 117 | getPoint(const double& p, Utils::Math::Point& Pt, const bool in01) const |
146 | 118 | { |
@@ -703,17 +675,6 @@ void Curve::getGroups(std::vector<Group::GroupEntity*>& grp) const |
703 | 675 | grp.insert(grp.end(), m_groups.begin(), m_groups.end()); |
704 | 676 | } |
705 | 677 | /*----------------------------------------------------------------------------*/ |
706 | | -void Curve::setGroups(std::vector<Group::GroupEntity*>& grp) |
707 | | -{ |
708 | | - m_groups.clear(); |
709 | | - for (std::vector<Group::GroupEntity*>::iterator iter = grp.begin(); iter != grp.end(); iter++){ |
710 | | - Group::Group1D* g1 = dynamic_cast<Group::Group1D*>(*iter); |
711 | | - if (g1 == 0) |
712 | | - throw TkUtil::Exception(TkUtil::UTF8String ("Erreur interne avec conversion en groupe local dans setGroups", TkUtil::Charset::UTF_8)); |
713 | | - m_groups.push_back(g1); |
714 | | - } |
715 | | -} |
716 | | -/*----------------------------------------------------------------------------*/ |
717 | 678 | int Curve::getNbGroups() const |
718 | 679 | { |
719 | 680 | return m_groups.size(); |
@@ -772,95 +733,6 @@ bool Curve::isBSpline() const |
772 | 733 | return false; |
773 | 734 | } |
774 | 735 | /*----------------------------------------------------------------------------*/ |
775 | | -Utils::SerializedRepresentation* Curve::getDescription (bool alsoComputed) const |
776 | | -{ |
777 | | - std::unique_ptr<Utils::SerializedRepresentation> description ( |
778 | | - GeomEntity::getDescription (alsoComputed)); |
779 | | - CHECK_NULL_PTR_ERROR (description.get ( )) |
780 | | - |
781 | | - Utils::SerializedRepresentation propertyGeomDescription ( |
782 | | - "Propriétés géométriques", ""); |
783 | | - |
784 | | - if (true == alsoComputed) |
785 | | - { |
786 | | - //recuperation de la longueur |
787 | | - TkUtil::UTF8String volStr (TkUtil::Charset::UTF_8); |
788 | | - volStr<<getArea(); |
789 | | - |
790 | | - propertyGeomDescription.addProperty ( |
791 | | - Utils::SerializedRepresentation::Property ("Longueur", volStr.ascii()) ); |
792 | | - } |
793 | | - |
794 | | -#ifdef _DEBUG // Issue#111 |
795 | | - // précision OpenCascade |
796 | | - for (uint i=0; i<m_occ_edges.size(); i++){ |
797 | | - TkUtil::UTF8String precStr (TkUtil::Charset::UTF_8); |
798 | | - precStr << BRep_Tool::Tolerance(m_occ_edges[i]); |
799 | | - propertyGeomDescription.addProperty ( |
800 | | - Utils::SerializedRepresentation::Property ("Précision", precStr.ascii()) ); |
801 | | - } |
802 | | -#endif // _DEBUG |
803 | | - |
804 | | - // on ajoute des infos du style: c'est une droite, un arc de cercle, une ellipse, une b-spline |
805 | | - TkUtil::UTF8String typeStr (TkUtil::Charset::UTF_8); |
806 | | - bool isABSpline = false; |
807 | | - if (isLinear()) |
808 | | - typeStr<<"segment"; |
809 | | - else if (isCircle()) |
810 | | - typeStr<<"cercle"; |
811 | | - else if (isEllipse()) |
812 | | - typeStr<<"ellipse"; |
813 | | - else if (isBSpline()){ |
814 | | - isABSpline = true; |
815 | | - typeStr<<"b-spline"; |
816 | | - } |
817 | | - else if (m_occ_edges.size()>1) |
818 | | - typeStr<<"composée"; |
819 | | - else |
820 | | - typeStr<<"quelconque"; |
821 | | - |
822 | | - propertyGeomDescription.addProperty ( |
823 | | - Utils::SerializedRepresentation::Property ("Type", typeStr)); |
824 | | - |
825 | | -#ifdef _DEBUG |
826 | | - if (isABSpline){ |
827 | | - TkUtil::UTF8String nbStr1 (TkUtil::Charset::UTF_8); |
828 | | - TkUtil::UTF8String nbStr2 (TkUtil::Charset::UTF_8); |
829 | | - |
830 | | - // c'est une spline => une seule représentation de type Edge |
831 | | - TopoDS_Edge edge = m_occ_edges[0]; |
832 | | - Standard_Real first_param, last_param; |
833 | | - Handle_Geom_Curve curve = BRep_Tool::Curve(edge, first_param, last_param); |
834 | | - |
835 | | - Handle(Geom_BSplineCurve) bspline = Handle(Geom_BSplineCurve)::DownCast(curve); |
836 | | - |
837 | | - nbStr1<<(long int)bspline->NbKnots(); |
838 | | - nbStr2<<(long int)bspline->NbPoles(); |
839 | | - |
840 | | - propertyGeomDescription.addProperty ( |
841 | | - Utils::SerializedRepresentation::Property ("Nb noeuds", nbStr1.ascii()) ); |
842 | | - propertyGeomDescription.addProperty ( |
843 | | - Utils::SerializedRepresentation::Property ("Nb poles", nbStr2.ascii()) ); |
844 | | - } |
845 | | - |
846 | | - // affichage des paramètres extrémas |
847 | | - double first, last; |
848 | | - getParameters(first, last); |
849 | | - TkUtil::UTF8String param1 (TkUtil::Charset::UTF_8); |
850 | | - param1<<first; |
851 | | - TkUtil::UTF8String param2 (TkUtil::Charset::UTF_8); |
852 | | - param2<<last; |
853 | | - propertyGeomDescription.addProperty ( |
854 | | - Utils::SerializedRepresentation::Property ("Param first", param1.ascii()) ); |
855 | | - propertyGeomDescription.addProperty ( |
856 | | - Utils::SerializedRepresentation::Property ("Param last", param2.ascii()) ); |
857 | | -#endif |
858 | | - |
859 | | - description->addPropertiesSet (propertyGeomDescription); |
860 | | - |
861 | | - return description.release ( ); |
862 | | -} |
863 | | -/*----------------------------------------------------------------------------*/ |
864 | 736 | } // end namespace Geom |
865 | 737 | /*----------------------------------------------------------------------------*/ |
866 | 738 | } // end namespace Mgx3D |
|
0 commit comments