aSplitCurves.end();
for (int iw=0; aCIt != aLastCIt; ++aCIt, iw++)
{
- std::stringstream brepName;
- brepName << "theSplitWire_";
- brepName << iw;
- brepName << ".brep";
- BRepTools::Write(aCIt->Wire() , brepName.str().c_str() );
- aResult.push_back(aCIt->Wire());
+ std::stringstream brepName;
+ brepName << "theSplitWire_";
+ brepName << iw;
+ brepName << ".brep";
+ BRepTools::Write(aCIt->Wire() , brepName.str().c_str() );
+ aResult.push_back(aCIt->Wire());
}
}
if( aPolyline.IsNull() )
return false;
- aPolyline->ImportShape(theShapes[i], false);
+ aPolyline->ImportShape(theShapes[i], false, false);
//aPolyline->SetShape( theShapes[i] );
//! the middle deflection is more than the required deflection and
//! more than the half of the maximal middle deflection.
//! Returns the initial maximal middle deflection.
- //! Returns a negative value in the case of any erorr.
+ //! Returns a negative value in the case of any error.
static double ReduceDeflection(
const double theDeflection,
HYDROData_TopoCurve& theCurve,
if ( aShape.IsNull() )
return false;
- return ImportShape( aShape );
+ return ImportShape( aShape, false );
#endif
}
}
bool anIsEdgeClosed = anEdgeGeomCurve->IsClosed();
+ anIsEdgeClosed &= IsCanBeClosed; // on split, resulting edges are normally not closed...
HYDROData_PolylineXY::SectionType aSectionType ;
if( anEdgeGeomCurve->IsKind( STANDARD_TYPE(Geom_Line) ) )
{
bool HYDROData_PolylineXY::ImportShape( const TopoDS_Shape& theShape,
bool IsInterpolationAllowed,
+ bool IsClosureAllowed,
double theDeviation )
{
DEBTRACE("ImportShape");
{
DEBTRACE("TopAbs_EDGE");
TopoDS_Edge anEdge = TopoDS::Edge( theShape );
- anIsCanBeImported = convertEdgeToSection( anEdge, aSectNames, aSectTypes,
- aSectClosures, aSectPoints, true, IsInterpolationAllowed, theDeviation );
+// anIsCanBeImported = convertEdgeToSection( anEdge, aSectNames, aSectTypes,
+// aSectClosures, aSectPoints, true, IsInterpolationAllowed, theDeviation );
+ anIsCanBeImported = convertEdgesToSections( anEdge, aSectNames, aSectTypes,
+ aSectClosures, aSectPoints, IsClosureAllowed, IsInterpolationAllowed, theDeviation );
}
else if ( theShape.ShapeType() == TopAbs_WIRE )
{
{
TopoDS_Edge aWireEdge = TopoDS::Edge( anEdges.Value( i ) );
anIsCanBeImported = convertEdgesToSections( aWireEdge, aSectNames, aSectTypes,
- aSectClosures, aSectPoints, false, IsInterpolationAllowed, theDeviation );
+ aSectClosures, aSectPoints, IsClosureAllowed, IsInterpolationAllowed, theDeviation );
}
}
class gp_Pnt;
/**\class HYDROData_PolylineXY
- * \brief Class that stores/retreives information about the
+ * \brief Class that stores/retrieves information about the
* parametric profile points.
*/
class HYDROData_PolylineXY : public HYDROData_IPolyline
HYDRODATA_EXPORT virtual void UpdateLocalCS( double theDx, double theDy );
/**
- * Checks that object has 2D presentation. Reimlemented to retun true.
+ * Checks that object has 2D presentation. Re-implemented to return true.
*/
HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
/**
* Returns data of object wrapped to QVariant.
- * Reimplemented to wrap and return saved path.
+ * Re-implemented to wrap and return saved path.
*/
HYDRODATA_EXPORT virtual QVariant GetDataVariant();
public:
/**
- * Returns the presentation of polyline section in CAS maner.
+ * Returns the presentation of polyline section in CAS manner.
*/
HYDRODATA_EXPORT static TopoDS_Wire BuildWire( const SectionType& theType,
const bool& theIsClosed,
const NCollection_Sequence<gp_XYZ>& thePoints );
/**
- * Returns the presentation of polyline section in Qt maner.
+ * Returns the presentation of polyline section in Qt manner.
*/
HYDRODATA_EXPORT static void BuildPainterPath( QPainterPath& thePath,
const SectionType& theType,
* Returns the 3D presentation of all points.
*/
HYDRODATA_EXPORT virtual bool ImportShape( const TopoDS_Shape& theShape,
- bool IsInterpolationAllowed = false,
- double theDeviation = 1E-3 );
+ bool IsInterpolationAllowed,
+ bool IsClosureAllowed = true,
+ double theDeviation = 1.);
/**
* Returns flag indicating that polyline can be edited or not.
bool HYDROData_TopoCurve::Initialize(const TopoDS_Wire& theWire)
{
- // Check for nonemptiness.
+ // Check for non-emptiness.
myEdges.clear();
TopTools_IndexedDataMapOfShapeListOfShape aVertexToEdges;
TopExp::MapShapesAndAncestors(theWire,
// const Adaptor3d_Curve& theCurve,
// double& theParameter);
-//! The type represents a 1 monifold connected topo curve
+//! The type represents a 1 manifold connected topo curve
//! with forward orientation.
class HYDROData_TopoCurve
{
HYDROData_TopoCurve(const TopoDS_Edge& theEdge) {myEdges.push_back(theEdge);}
//! Initializes the curve by the wire.
- //! Returns 'false' if the wire is not 1 monifold or
+ //! Returns 'false' if the wire is not 1 manifold or
//! is disconnected or is empty.
HYDRODATA_EXPORT bool Initialize(const TopoDS_Wire& theWire);
anIsOk = true;
} else if ( myOpType == ImportSelectedAsPolyline ) {
Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast( anObject );
- anIsOk = aPolyline->ImportShape( aShape );
+ anIsOk = aPolyline->ImportShape( aShape, false );
/* TODO: check it before start operation
if ( anIsOk && !aPolyline->IsEditable() )
aTypes << GEOM::WIRE << GEOM::EDGE;
return aTypes;
-}
\ No newline at end of file
+}
if( !aPolylineObj.IsNull() ) {
aPolylineObj->SetName( aName );
- aPolylineObj->ImportShape( aShape );
+ aPolylineObj->ImportShape( aShape, false );
aPolylineObj->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
aPolylineObj->Update();
TopoDS_Shape aSubShape = aSubShapes.Value( i );
// Transform the sub-shape
- aPolylineObj->ImportShape( aSubShape );
+ aPolylineObj->ImportShape( aSubShape, false );
aPolylineObj->Transform( aTrsf );
/*
// update the object browser
module()->getApp()->updateObjectBrowser( true );
}
-}
\ No newline at end of file
+}