1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

Compare commits

..

1 Commits

937 changed files with 5628 additions and 14650 deletions

View File

@@ -108,7 +108,6 @@ n BRepMesh
n BRepMeshData
n BRepOffset
n BRepOffsetAPI
n BRepPreviewAPI
n BRepPrim
n BRepPrimAPI
n BRepProj

View File

@@ -64,7 +64,7 @@ Then makefiles will appear in the build folder (e.g. <i> D:/occt/build-android <
Alternatively one may specify the values without a toolchain file:
> cmake -G "MinGW Makefiles" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=D:/DevTools/android-ndk-r13b -DCMAKE_ANDROID_STL_TYPE=gnustl_shared -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_MAKE_PROGRAM=D:/DevTools/MinGW/bin/mingw32-make.exe -D3RDPARTY_DIR=D:/occt-3rdparty D:/occt
> cmake -G "MinGW Makefiles" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=D:/DevTools/android-ndk-r13b -DCMAKE_ANDROID_STL_TYPE=gnustl_shared -DCMAKE_SYSTEM_VERSION=15 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_MAKE_PROGRAM=D:/DevTools/MinGW/bin/mingw32-make.exe -D3RDPARTY_DIR=D:/occt-3rdparty D:/occt
@figure{/dev_guides/building/android/images/android_image006.png}

View File

@@ -150,8 +150,7 @@ Steps to prepare dump of the object into json:
1. Create method <b>DumpJson</b>. The method should accept the output stream and the depth for the fields dump.
Depth, equal to zero means that only fields of this class should be dumped. Default value -1 means that whole tree of dump will be built recursively calling dump of all fields.
2. Put into the first row of the method <b>OCCT_DUMP_CLASS_BEGIN</b> or <b>OCCT_DUMP_TRANSIENT_CLASS_BEGIN</b> (for Standard_Transient objects).
This macro appends class name into output stream.
2. Put into the first row of the method <b>OCCT_DUMP_CLASS_BEGIN</b>. This macro creates a local variable, that will open Json structure on start, and close on exit from this method.
3. Add several macro to store field values.

View File

@@ -1888,7 +1888,3 @@ Unexpected const-ness of Aspect_Window::DoResize() method has been removed, so t
@subsection upgrade_750_rename Renaming of types
Enumeration BRepOffset_Type is renamed to ChFiDS_TypeOfConcavity.
@subsection upgrade_750_sensitiveEntity Select3D_SensitiveEntity interface change
The method Select3D_SensitiveEntity::NbSubElements() has been changed to be constant. Select3D_SensitiveEntity subclasses at application level should be updated accordingly.

View File

@@ -86,7 +86,7 @@ sage " Fusion of this prism with the original part "
sage " fuse result rr result"
sage " "
fuse result rr result
donly result
donl result
nexplode result f
erase result
fit
@@ -108,13 +108,13 @@ ttranslate cyl cyl 0 7.5 0
sage " Display the Shape on Hidden Line Mode "
sage " hlr hid r"
sage ""
donly r
donl r
hlr hid r
sage " Display the Shape on HLR Mode "
sage " hlr nohid r"
sage " hlr hlr r"
sage ""
donly r
donl r
hlr nohid r
hlr hlr r
sage "Demo completed"

View File

@@ -57,10 +57,11 @@ for {set i 0} {$i < 12} {incr i} {
}
# Configure light sources
vlight -change 0 -head 0
vlight -change 0 -direction -0.25 -1 -1
vlight -change 0 -sm 0.3
vlight -change 0 -int 10.0
vlight del 1
vlight change 0 head 0
vlight change 0 direction -0.25 -1 -1
vlight change 0 sm 0.3
vlight change 0 int 10
# Load environment map
vtextureenv on 1

View File

@@ -12,8 +12,11 @@ vinit name=View1 w=512 h=512
vglinfo
# setup light sources
vlight -clear
vlight -add positional -head 0 -pos 0.5 0.5 0.85 -sm 0.06 -int 30.0
vlight del 0
vlight del 1
vlight add positional head 0 pos 0.5 0.5 0.85
vlight change 0 sm 0.06
vlight change 0 int 30.0
vvbo 0
vsetdispmode 1

View File

@@ -208,9 +208,8 @@ vviewparams -eye 139.412 -1.62643 178.037
vviewparams -size 170.508
# Restore light source parameters
vlight -clear
vlight -add ambient
vlight -add directional -direction -0.303949 -0.434084 -0.848048 -smoothness 0.3 -intensity 12
vlight clear
vlight add directional direction -0.303949 -0.434084 -0.848048 smoothness 0.3 intensity 12
# Load environment map
vtextureenv on 1

View File

@@ -1,91 +0,0 @@
# Script demonstrating PBR metallic-roughness material properties
#Category: Visualization
#Title: PBR metallic-rougness spheres
pload XDE OCAF MODELING VISUALIZATION
psphere s 0.35
catch { Close D }
XNewDoc D
# grid of spheres
set THE_UPPER 6
foreach i [list 0 3] {
set aPrefix ""
set aColor "GRAY80"
if { $i != 0 } {
set aPrefix "g_";
set aColor "CCB11D"
}
set aColShapes {}
for { set m 0 } { $m <= $THE_UPPER } { incr m } {
set aRowShapes {}
for { set r 0 } { $r <= $THE_UPPER } { incr r } {
set aName ${aPrefix}m${m}r${r}
copy s $aName
lappend aRowShapes $aName
ttranslate $aName ${r} ${i} ${m}
}
set aName ${aPrefix}m${m}
compound {*}$aRowShapes $aName
lappend aColShapes $aName
}
set aName ${aPrefix}spheres
compound {*}$aColShapes $aName
set aLabName "Gray Spheres"
if { $i != 0 } { set aLabName "Golden Spheres" }
set aLabComp [XAddShape D $aName 0]
SetName D $aLabComp $aLabName
for { set m 0 } { $m <= $THE_UPPER } { incr m } {
set aMet [expr 100 * ${m}/$THE_UPPER]
set aName ${aPrefix}m${m}
XAddComponent D $aLabComp $aName
set aLabCompCol [XFindShape D $aName]
SetName D $aLabCompCol "${aPrefix}m${aMet}%"
SetName D {*}[XFindComponent D $aName] "${aPrefix}m${aMet}%"
for { set r 0 } { $r <= $THE_UPPER } { incr r } {
set aRoug [expr 100 * ${r}/$THE_UPPER]
set aName ${aPrefix}m${m}r${r}
XAddComponent D $aLabCompCol $aName
set aLab [XFindComponent D $aName]
SetName D {*}$aLab "${aPrefix}m${aMet}%_r${aRoug}%"
XAddVisMaterial D $aName -baseColor $aColor -metallic ${m}/$THE_UPPER -roughness ${r}/$THE_UPPER
XSetVisMaterial D {*}$aLab $aName
}
}
}
set aLab [XFindShape D s]
SetName D {*}$aLab "Sphere"
XGetAllVisMaterials D
# labels
text2brep tm "Metal" -plane 0 -1 0 0 0 -1 -height 0.5 -pos -0.5 0 6.5 -halign left -valign top -font monospace
text2brep tnm "Non-metal" -plane 0 -1 0 0 0 -1 -height 0.5 -pos -0.5 0 -0.5 -halign right -valign top -font monospace
text2brep ts "Smooth" -plane 0 -1 0 1 0 0 -height 0.5 -pos -0.5 0 -0.5 -halign left -valign top -font monospace
text2brep tr "Rough" -plane 0 -1 0 1 0 0 -height 0.5 -pos 6.5 0 -0.5 -halign right -valign top -font monospace
compound tm tnm ts tr labs
set aLab [XAddShape D labs 0]
SetName D $aLab "Labels"
XAddComponent D $aLab tm
XAddComponent D $aLab tnm
XAddComponent D $aLab ts
XAddComponent D $aLab tr
SetName D {*}[XFindComponent D tm] "Metal"
SetName D [XFindShape D tm] "Metal"
SetName D {*}[XFindComponent D tnm] "Non-metal"
SetName D [XFindShape D tnm] "Non-metal"
SetName D {*}[XFindComponent D ts] "Smooth"
SetName D [XFindShape D ts] "Smooth"
SetName D {*}[XFindComponent D tr] "Rough"
SetName D [XFindShape D tr] "Rough"
vclear
vinit View1 -width 768 -height 768
vfront
vrenderparams -shadingModel PBR
vlight -change 0 -intensity 2.5
XDisplay -dispMode 1 D
vcamera -ortho
vfit

View File

@@ -2554,15 +2554,6 @@ void AIS_InteractiveContext::SetTransformPersistence (const Handle(AIS_Interacti
const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
theObject->SetTransformPersistence (theTrsfPers);
UpdateOnTransformPersistence (theObject);
}
//=======================================================================
//function : UpdateOnTransformPersistence
//purpose :
//=======================================================================
void AIS_InteractiveContext::UpdateOnTransformPersistence (const Handle(AIS_InteractiveObject)& theObject)
{
if (!myObjects.IsBound (theObject))
{
return;

View File

@@ -344,11 +344,6 @@ public: //! @name object local transformation management
Standard_EXPORT void SetTransformPersistence (const Handle(AIS_InteractiveObject)& theObject,
const Handle(Graphic3d_TransformPers)& theTrsfPers);
//! Updates displayed interactive object by checking and recomputing its flagged as "to be recomputed" presentation and selection structures.
//! This method does not force any recomputation on its own.
//! The method recomputes selections even if they are loaded without activation in particular selector.
Standard_EXPORT void UpdateOnTransformPersistence (const Handle(AIS_InteractiveObject)& theIObj);
Standard_DEPRECATED("This method is deprecated - SetTransformPersistence() taking Graphic3d_TransformPers should be called instead")
void SetTransformPersistence (const Handle(AIS_InteractiveObject)& theObj,
const Graphic3d_TransModeFlags& theFlag,
@@ -1221,9 +1216,6 @@ public: //! @name sub-intensity management (deprecated)
//! @param theSelection an instance of the selection
void SetSelection (const Handle(AIS_Selection)& theSelection) { mySelection = theSelection; }
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected: //! @name internal methods
Standard_EXPORT void GetDefModes (const Handle(AIS_InteractiveObject)& anIobj, Standard_Integer& Dmode, Standard_Integer& HiMod, Standard_Integer& SelMode) const;

View File

@@ -86,42 +86,3 @@ void AIS_InteractiveContext::PolygonOffsets(
anObj->PolygonOffsets( aMode, aFactor, aUnits );
}
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void AIS_InteractiveContext::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myObjects.Size())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, mgrSelector.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMainPM.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMainVwr.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMainSel.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myLastActiveView)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myLastPicked.get())
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToHilightSelected)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, mySelection.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myFilters.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myDefaultDrawer.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStyles[Prs3d_TypeOfHighlight_Selected])
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStyles[Prs3d_TypeOfHighlight_Dynamic])
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStyles[Prs3d_TypeOfHighlight_LocalSelected])
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStyles[Prs3d_TypeOfHighlight_LocalDynamic])
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStyles[Prs3d_TypeOfHighlight_SubIntensity])
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDetectedSeq.Size())
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurDetected)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurHighlighted)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPickingStrategy)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAutoHilight)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsAutoActivateSelMode)
}

View File

@@ -83,17 +83,6 @@ void AIS_InteractiveObject::SetContext (const Handle(AIS_InteractiveContext)& th
}
}
//-----------------------------------------------------------------------------
void AIS_InteractiveObject::SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
SelectMgr_SelectableObject::SetTransformPersistence (theTrsfPers);
if (!GetContext().IsNull())
{
GetContext()->UpdateOnTransformPersistence (this);
}
}
//=======================================================================
//function : HasPresentation
//purpose :
@@ -159,11 +148,11 @@ void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& theAspect
//function : DumpJson
//purpose :
//=======================================================================
void AIS_InteractiveObject::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
void AIS_InteractiveObject::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_CLASS_BEGIN (theOStream, AIS_InteractiveObject);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, SelectMgr_SelectableObject)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCTXPtr)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myOwner)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, SelectMgr_SelectableObject);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCTXPtr);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myOwner);
}

View File

@@ -108,11 +108,6 @@ public:
//! Returns the context pointer to the interactive context.
Standard_EXPORT Handle(AIS_InteractiveContext) GetContext() const;
//! Sets up Transform Persistence defining a special Local Coordinate system where this object should be located.
//! Updates the presentation in context if it is not NULL
//! @sa Graphic3d_TransformPers class description
Standard_EXPORT virtual void SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers);
//! Returns TRUE when this object has a presentation in the current DisplayMode()
Standard_EXPORT Standard_Boolean HasPresentation() const;
@@ -124,7 +119,7 @@ public:
Standard_EXPORT void SetAspect (const Handle(Prs3d_BasicAspect)& anAspect);
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:
//! The TypeOfPresention3d means that the interactive object

View File

@@ -990,19 +990,3 @@ Standard_Boolean AIS_Shape::OwnHLRDeviationAngle ( Standard_Real & anAngle,
aPreviousAngle = myDrawer->PreviousHLRDeviationAngle ();
return myDrawer->HasOwnHLRDeviationAngle();
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void AIS_Shape::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, AIS_InteractiveObject)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myshape)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBB)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myInitAng)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCompBB)
}

View File

@@ -325,9 +325,6 @@ public:
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer);
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:
TopoDS_Shape myshape; //!< shape to display

View File

@@ -926,20 +926,3 @@ void AIS_Trihedron::updatePrimitives(const Handle(Prs3d_DatumAspect)& theAspect,
myPrimitives.Bind(aPart, aPrims);
}
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void AIS_Trihedron::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, AIS_InteractiveObject)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnSize)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnTextColor)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnArrowColor)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDatumAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTrihDispMode)
}

View File

@@ -219,9 +219,6 @@ protected:
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode) Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:
//! Creates a sensitive entity for the datum part that will be used in selection owner creation.

View File

@@ -113,15 +113,6 @@ AIS_ViewController::AIS_ViewController()
myMouseGestureMap.Bind (Aspect_VKeyMouse_MiddleButton | Aspect_VKeyFlags_CTRL, AIS_MouseGesture_Pan);
}
// =======================================================================
// function : ~AIS_ViewController
// purpose :
// =======================================================================
AIS_ViewController::~AIS_ViewController()
{
//
}
// =======================================================================
// function : ResetViewInput
// purpose :

View File

@@ -51,9 +51,6 @@ public:
//! Empty constructor.
Standard_EXPORT AIS_ViewController();
//! Destructor.
Standard_EXPORT virtual ~AIS_ViewController();
//! Return input buffer.
const AIS_ViewInputBuffer& InputBuffer (AIS_ViewInputBufferType theType) const { return theType == AIS_ViewInputBufferType_UI ? myUI : myGL; }

View File

@@ -656,16 +656,19 @@ static Standard_Integer nbPoints(const Handle(Adaptor2d_HCurve2d)& theCurve)
Standard_Integer nbs = 20;
if (theCurve->GetType() == GeomAbs_BezierCurve)
if (theCurve->GetType() == GeomAbs_Line)
nbs = 2;
else if (theCurve->GetType() == GeomAbs_BezierCurve)
{
nbs = Max(nbs, 3 + theCurve->NbPoles());
nbs = 3 + theCurve->NbPoles();
}
else if (theCurve->GetType() == GeomAbs_BSplineCurve) {
nbs = Max(nbs, theCurve->NbKnots() * theCurve->Degree());
nbs = theCurve->NbKnots();
nbs *= theCurve->Degree();
}
if (nbs > 300)
nbs = 300;
if (nbs > 200)
nbs = 200;
return nbs;
}

View File

@@ -16,7 +16,6 @@
//AGV 15/10/01 : Add XmlOcaf support; add MessageDriver support
#include <AppStd_Application.hxx>
#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AppStd_Application,TDocStd_Application)
@@ -30,13 +29,3 @@ Standard_CString AppStd_Application::ResourcesName() {
return aRes;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void AppStd_Application::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDocStd_Application)
}

View File

@@ -35,9 +35,6 @@ public:
//! resources
Standard_EXPORT Standard_CString ResourcesName() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
DEFINE_STANDARD_RTTIEXT(AppStd_Application,TDocStd_Application)
};

View File

@@ -16,7 +16,6 @@
//AGV 15/10/01 : Add XmlOcaf support; add MessageDriver support
#include <AppStdL_Application.hxx>
#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AppStdL_Application,TDocStd_Application)
@@ -31,13 +30,3 @@ Standard_CString AppStdL_Application::ResourcesName()
return aRes;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void AppStdL_Application::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDocStd_Application)
}

View File

@@ -34,9 +34,6 @@ public:
//! resources
Standard_EXPORT Standard_CString ResourcesName() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
DEFINE_STANDARD_RTTIEXT(AppStdL_Application,TDocStd_Application)
};

View File

@@ -27,7 +27,6 @@
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2dAdaptor_HCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <GeomAdaptor_HSurface.hxx>
@@ -612,69 +611,15 @@ Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d
gp_Pnt2d aF2d = theC2D->Value(theC2D->FirstParameter());
gp_Pnt2d aL2d = theC2D->Value(theC2D->LastParameter());
Standard_Boolean isToTrim = Standard_True;
Standard_Real U1, U2, V1, V2;
aSurf->Bounds(U1, U2, V1, V2);
if (theIsU)
{
Standard_Real aV1Param = Min(aF2d.Y(), aL2d.Y());
Standard_Real aV2Param = Max(aF2d.Y(), aL2d.Y());
if (aV2Param < V1 - myTol || aV1Param > V2 + myTol)
{
return Standard_False;
}
else if (Precision::IsInfinite(V1) || Precision::IsInfinite(V2))
{
if (Abs(aV2Param - aV1Param) < Precision::PConfusion())
{
return Standard_False;
}
aSurf = new Geom_RectangularTrimmedSurface(aSurf, U1, U2, aV1Param, aV2Param);
isToTrim = Standard_False;
}
else
{
aV1Param = Max(aV1Param, V1);
aV2Param = Min(aV2Param, V2);
if (Abs(aV2Param - aV1Param) < Precision::PConfusion())
{
return Standard_False;
}
}
aC3d = aSurf->UIso(theParam);
if (isToTrim)
aC3d = new Geom_TrimmedCurve(aC3d, aV1Param, aV2Param);
aC3d = new Geom_TrimmedCurve(aC3d, aF2d.Y(), aL2d.Y());
}
else
{
Standard_Real aU1Param = Min(aF2d.X(), aL2d.X());
Standard_Real aU2Param = Max(aF2d.X(), aL2d.X());
if (aU2Param < U1 - myTol || aU1Param > U2 + myTol)
{
return Standard_False;
}
else if (Precision::IsInfinite(U1) || Precision::IsInfinite(U2))
{
if (Abs(aU2Param - aU1Param) < Precision::PConfusion())
{
return Standard_False;
}
aSurf = new Geom_RectangularTrimmedSurface(aSurf, aU1Param, aU2Param, V1, V2);
isToTrim = Standard_False;
}
else
{
aU1Param = Max(aU1Param, U1);
aU2Param = Min(aU2Param, U2);
if (Abs(aU2Param - aU1Param) < Precision::PConfusion())
{
return Standard_False;
}
}
aC3d = aSurf->VIso(theParam);
if (isToTrim)
aC3d = new Geom_TrimmedCurve(aC3d, aU1Param, aU2Param);
aC3d = new Geom_TrimmedCurve(aC3d, aF2d.X(), aL2d.X());
}
// Convert arbitrary curve type to the b-spline.

View File

@@ -92,16 +92,3 @@ Handle(BRep_CurveRepresentation) BRep_Curve3D::Copy() const
C->SetRange(First(), Last());
return C;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_Curve3D::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_GCurve)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCurve.get())
}

View File

@@ -54,9 +54,6 @@ public:
//! Return a copy of this representation.
Standard_EXPORT Handle(BRep_CurveRepresentation) Copy() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -147,20 +147,3 @@ Handle(BRep_CurveRepresentation) BRep_CurveOn2Surfaces::Copy() const
myContinuity);
return C;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_CurveOn2Surfaces::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_CurveRepresentation)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface2.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLocation2)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContinuity)
}

View File

@@ -66,9 +66,6 @@ public:
//! Return a copy of this representation.
Standard_EXPORT Handle(BRep_CurveRepresentation) Copy() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -180,20 +180,4 @@ void BRep_CurveOnClosedSurface::Update()
BRep_CurveOnSurface::Update();
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_CurveOnClosedSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_CurveOnSurface)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPCurve2.get())
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContinuity)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myUV21)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myUV22)
}

View File

@@ -78,9 +78,6 @@ public:
//! This is called when the range is modified.
Standard_EXPORT virtual void Update() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -146,20 +146,4 @@ void BRep_CurveOnSurface::Update()
}
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_CurveOnSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_GCurve)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myUV1)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myUV2)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPCurve.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface.get())
}

View File

@@ -71,9 +71,6 @@ public:
//! This is called when the range is modified.
Standard_EXPORT virtual void Update() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -426,13 +426,3 @@ void BRep_CurveRepresentation::Polygon2(const Handle(Poly_Polygon2D)&)
throw Standard_DomainError("BRep_CurveRepresentation");
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_CurveRepresentation::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLocation)
}

View File

@@ -144,9 +144,6 @@ public:
//! Return a copy of this representation.
Standard_EXPORT virtual Handle(BRep_CurveRepresentation) Copy() const = 0;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;

View File

@@ -46,16 +46,3 @@ void BRep_GCurve::Update()
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_GCurve::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_CurveRepresentation)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirst)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLast)
}

View File

@@ -57,9 +57,6 @@ public:
//! This is called when the range is modified.
Standard_EXPORT virtual void Update();
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -80,16 +80,4 @@ void BRep_PointOnCurve::Curve(const Handle(Geom_Curve)& C)
myCurve = C;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_PointOnCurve::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_PointRepresentation)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurve.get())
}

View File

@@ -48,9 +48,6 @@ public:
Standard_EXPORT virtual void Curve (const Handle(Geom_Curve)& C) Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -84,16 +84,4 @@ void BRep_PointOnCurveOnSurface::PCurve(const Handle(Geom2d_Curve)& C)
myPCurve = C;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_PointOnCurveOnSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_PointRepresentation)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPCurve.get())
}

View File

@@ -50,9 +50,6 @@ public:
Standard_EXPORT virtual void PCurve (const Handle(Geom2d_Curve)& C) Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -197,15 +197,4 @@ void BRep_PointRepresentation::Surface(const Handle(Geom_Surface)& )
throw Standard_DomainError("BRep_PointRepresentation");
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_PointRepresentation::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLocation)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myParameter)
}

View File

@@ -84,9 +84,6 @@ public:
Standard_EXPORT virtual void Surface (const Handle(Geom_Surface)& S);
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;

View File

@@ -56,17 +56,4 @@ void BRep_PointsOnSurface::Surface(const Handle(Geom_Surface)& S)
mySurface = S;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_PointsOnSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_PointRepresentation)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface.get())
}

View File

@@ -40,9 +40,6 @@ public:
Standard_EXPORT virtual void Surface (const Handle(Geom_Surface)& S) Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -76,15 +76,3 @@ Handle(BRep_CurveRepresentation) BRep_Polygon3D::Copy() const
return P;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_Polygon3D::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_CurveRepresentation)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPolygon3D.get())
}

View File

@@ -50,9 +50,6 @@ public:
//! Return a copy of this representation.
Standard_EXPORT Handle(BRep_CurveRepresentation) Copy() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -79,16 +79,3 @@ Handle(BRep_CurveRepresentation) BRep_PolygonOnClosedSurface::Copy() const
return P;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_PolygonOnClosedSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_PolygonOnSurface)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPolygon2.get())
}

View File

@@ -51,9 +51,6 @@ public:
//! Return a copy of this representation.
Standard_EXPORT virtual Handle(BRep_CurveRepresentation) Copy() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -84,15 +84,3 @@ Handle(BRep_CurveRepresentation) BRep_PolygonOnClosedTriangulation::Copy() const
return P;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_PolygonOnClosedTriangulation::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_PolygonOnTriangulation)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPolygon2.get())
}

View File

@@ -51,9 +51,6 @@ public:
//! Return a copy of this representation.
Standard_EXPORT virtual Handle(BRep_CurveRepresentation) Copy() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -102,16 +102,3 @@ Handle(BRep_CurveRepresentation) BRep_PolygonOnSurface::Copy() const
return P;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_PolygonOnSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_CurveRepresentation)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPolygon2D.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface.get())
}

View File

@@ -59,9 +59,6 @@ public:
//! Return a copy of this representation.
Standard_EXPORT virtual Handle(BRep_CurveRepresentation) Copy() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -104,17 +104,3 @@ Handle(BRep_CurveRepresentation) BRep_PolygonOnTriangulation::Copy() const
return P;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_PolygonOnTriangulation::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_CurveRepresentation)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPolygon.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTriangulation.get())
}

View File

@@ -58,9 +58,6 @@ public:
//! Return a copy of this representation.
Standard_EXPORT virtual Handle(BRep_CurveRepresentation) Copy() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -141,22 +141,3 @@ Handle(TopoDS_TShape) BRep_TEdge::EmptyCopy() const
return TE;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_TEdge::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TopoDS_TEdge)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFlags)
for (BRep_ListIteratorOfListOfCurveRepresentation itr(myCurves); itr.More(); itr.Next())
{
const Handle(BRep_CurveRepresentation)& aCurveRepresentation = itr.Value();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aCurveRepresentation.get())
}
}

View File

@@ -81,9 +81,6 @@ public:
//! Returns a copy of the TShape with no sub-shapes.
Standard_EXPORT Handle(TopoDS_TShape) EmptyCopy() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -50,21 +50,3 @@ Handle(TopoDS_TShape) BRep_TFace::EmptyCopy() const
TF->Tolerance(myTolerance);
return TF;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_TFace::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TopoDS_TFace)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTriangulation.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLocation)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNaturalRestriction)
}

View File

@@ -88,9 +88,6 @@ public:
//! The new Face has no triangulation.
Standard_EXPORT virtual Handle(TopoDS_TShape) EmptyCopy() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -47,21 +47,3 @@ Handle(TopoDS_TShape) BRep_TVertex::EmptyCopy() const
return TV;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void BRep_TVertex::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TopoDS_TVertex)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPnt)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance)
for (BRep_ListIteratorOfListOfPointRepresentation itr(myPoints); itr.More(); itr.Next())
{
const Handle(BRep_PointRepresentation)& aPointRepresentation = itr.Value();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aPointRepresentation.get())
}
}

View File

@@ -62,9 +62,6 @@ public:
//! Returns a copy of the TShape with no sub-shapes.
Standard_EXPORT Handle(TopoDS_TShape) EmptyCopy() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -27,7 +27,6 @@
#include <Precision.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <Geom2dAPI_ProjectPointOnCurve.hxx>
static const Standard_Real Probing_Start = 0.123;
static const Standard_Real Probing_End = 0.7;
@@ -141,7 +140,7 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P,
gp_Lin2d& L,
Standard_Real& Par)
{
TopExp_Explorer anExpF(myFace, TopAbs_EDGE);
TopExp_Explorer anExpF(myFace,TopAbs_EDGE);
Standard_Integer i;
Standard_Real aFPar;
Standard_Real aLPar;
@@ -154,7 +153,7 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P,
if (i != myCurEdgeInd)
continue;
const TopoDS_Shape &aLocalShape = anExpF.Current();
const TopoDS_Shape &aLocalShape = anExpF.Current();
const TopAbs_Orientation anOrientation = aLocalShape.Orientation();
if (anOrientation == TopAbs_FORWARD || anOrientation == TopAbs_REVERSED) {
@@ -163,29 +162,27 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P,
aC2d = BRep_Tool::CurveOnSurface(anEdge, myFace, aFPar, aLPar);
if (!aC2d.IsNull()) {
// Treatment of infinite cases.
if (Precision::IsNegativeInfinite(aFPar)) {
if (Precision::IsPositiveInfinite(aLPar)) {
aFPar = -1.;
aLPar = 1.;
}
else {
aFPar = aLPar - 1.;
}
}
else if (Precision::IsPositiveInfinite(aLPar))
aLPar = aFPar + 1.;
// Treatment of infinite cases.
if (Precision::IsNegativeInfinite(aFPar)) {
if (Precision::IsPositiveInfinite(aLPar)) {
aFPar = -1.;
aLPar = 1.;
} else {
aFPar = aLPar - 1.;
}
} else if (Precision::IsPositiveInfinite(aLPar))
aLPar = aFPar + 1.;
for (; myCurEdgePar < Probing_End; myCurEdgePar += Probing_Step) {
aParamIn = myCurEdgePar*aFPar + (1. - myCurEdgePar)*aLPar;
for (; myCurEdgePar < Probing_End ;myCurEdgePar += Probing_Step) {
aParamIn = myCurEdgePar*aFPar + (1. - myCurEdgePar)*aLPar;
gp_Vec2d aTanVec;
aC2d->D1(aParamIn, aPOnC, aTanVec);
Par = aPOnC.SquareDistance(P);
aC2d->D1(aParamIn, aPOnC, aTanVec);
Par = aPOnC.SquareDistance(P);
if (Par > aTolParConf2) {
gp_Vec2d aLinVec(P, aPOnC);
gp_Dir2d aLinDir(aLinVec);
if (Par > aTolParConf2) {
gp_Vec2d aLinVec(P, aPOnC);
gp_Dir2d aLinDir(aLinVec);
Standard_Real aTanMod = aTanVec.SquareMagnitude();
if (aTanMod < aTolParConf2)
@@ -193,10 +190,8 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P,
aTanVec /= Sqrt(aTanMod);
Standard_Real aSinA = aTanVec.Crossed(aLinDir.XY());
const Standard_Real SmallAngle = 0.001;
Standard_Boolean isSmallAngle = Standard_False;
if (Abs(aSinA) < SmallAngle)
{
isSmallAngle = Standard_True;
// The line from the input point P to the current point on edge
// is tangent to the edge curve. This condition is bad for classification.
// Therefore try to go to another point in the hope that there will be
@@ -206,66 +201,28 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P,
continue;
}
L = gp_Lin2d(P, aLinDir);
L = gp_Lin2d(P, aLinDir);
// Check if ends of a curve lie on a line.
aC2d->D0(aFPar, aPOnC);
gp_Pnt2d aFPOnC = aPOnC;
if (L.SquareDistance(aPOnC) > aTolParConf2) {
aC2d->D0(aLPar, aPOnC);
if (L.SquareDistance(aPOnC) > aTolParConf2) {
// Check if ends of a curve lie on a line.
aC2d->D0(aFPar, aPOnC);
if (isSmallAngle)
{
//Try to find minimal distance between curve and line
if (L.SquareDistance(aPOnC) > aTolParConf2) {
aC2d->D0(aLPar, aPOnC);
Geom2dAPI_ProjectPointOnCurve aProj;
aProj.Init(P, aC2d, aFPar, aLPar);
if (aProj.NbPoints() > 0)
{
gp_Pnt2d aLPOnC = aPOnC;
Standard_Real aFDist = P.SquareDistance(aFPOnC);
Standard_Real aLDist = P.SquareDistance(aLPOnC);
Standard_Real aMinDist = aProj.LowerDistance();
aMinDist *= aMinDist;
aPOnC = aProj.NearestPoint();
if (aMinDist > aFDist)
{
aMinDist = aFDist;
aPOnC = aFPOnC;
}
//
if (aMinDist > aLDist)
{
aMinDist = aLDist;
aPOnC = aLPOnC;
}
//
if (aMinDist < Par)
{
Par = aMinDist;
if (Par < aTolParConf2)
{
continue;
}
aLinVec.SetXY((aPOnC.XY() - P.XY()));
aLinDir.SetXY(aLinVec.XY());
L = gp_Lin2d(P, aLinDir);
}
}
}
myCurEdgePar += Probing_Step;
if (myCurEdgePar >= Probing_End) {
myCurEdgeInd++;
myCurEdgePar = Probing_Start;
}
if (L.SquareDistance(aPOnC) > aTolParConf2) {
myCurEdgePar += Probing_Step;
Par = Sqrt(Par);
return Standard_True;
}
}
}
}
if (myCurEdgePar >= Probing_End) {
myCurEdgeInd++;
myCurEdgePar = Probing_Start;
}
Par = Sqrt(Par);
return Standard_True;
}
}
}
}
} // if (!aC2d.IsNull()) {
} // if (anOrientation == TopAbs_FORWARD ...
@@ -276,7 +233,7 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P,
// nothing found, return an horizontal line
Par = RealLast();
L = gp_Lin2d(P, gp_Dir2d(1, 0));
L = gp_Lin2d(P,gp_Dir2d(1,0));
return Standard_False;
}

View File

@@ -105,15 +105,20 @@ static Handle(Geom_BSplineCurve) EdgeToBSpline (const TopoDS_Edge& theEdge)
Handle(Geom_Curve) aCurve = BRep_Tool::Curve (theEdge, aLoc, aFirst, aLast);
// convert its part used by edge to bspline; note that if edge curve is bspline,
// approximation or conversion made via trimmed curve is still needed -- it will copy it,
// segment as appropriate, and remove periodicity if it is periodic (deadly for approximator)
// conversion made via trimmed curve is still needed -- it will copy it, segment
// as appropriate, and remove periodicity if it is periodic (deadly for approximator)
Handle(Geom_TrimmedCurve) aTrimCurve = new Geom_TrimmedCurve (aCurve, aFirst, aLast);
const Handle(Geom_Curve)& aCurveTemp = aTrimCurve; // to avoid ambiguity
GeomConvert_ApproxCurve anAppr (aCurveTemp, Precision::Confusion(), GeomAbs_C1, 16, 14);
if (anAppr.HasResult())
aBSCurve = anAppr.Curve();
// special treatment of conic curve
if (aTrimCurve->BasisCurve()->IsKind(STANDARD_TYPE(Geom_Conic)))
{
const Handle(Geom_Curve)& aCurveTemp = aTrimCurve; // to avoid ambiguity
GeomConvert_ApproxCurve anAppr (aCurveTemp, Precision::Confusion(), GeomAbs_C1, 16, 14);
if (anAppr.HasResult())
aBSCurve = anAppr.Curve();
}
// general case
if (aBSCurve.IsNull())
aBSCurve = GeomConvert::CurveToBSplineCurve (aTrimCurve);

View File

@@ -18,7 +18,6 @@
#include <GCPnts_AbscissaPoint.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAbs_IsoType.hxx>
#include <BRep_Tool.hxx>
//=======================================================================
// Function: Reset
@@ -126,14 +125,9 @@ void BRepMesh_DefaultRangeSplitter::computeTolerance(
const Standard_Real aDiffU = myRangeU.second - myRangeU.first;
const Standard_Real aDiffV = myRangeV.second - myRangeV.first;
const Standard_Real aTolerance = BRep_Tool::Tolerance (myDFace->GetFace());
const Adaptor3d_Surface& aSurface = GetSurface()->Surface();
const Standard_Real aResU = aSurface.UResolution (aTolerance);
const Standard_Real aResV = aSurface.VResolution (aTolerance);
const Standard_Real aDeflectionUV = 1.e-05;
myTolerance.first = Max(Min(aDeflectionUV, aResU), 1e-7 * aDiffU);
myTolerance.second = Max(Min(aDeflectionUV, aResV), 1e-7 * aDiffV);
myTolerance.first = Max(Min(aDeflectionUV, 0.1 * aDiffU), 1e-7 * aDiffU);
myTolerance.second = Max(Min(aDeflectionUV, 0.1 * aDiffV), 1e-7 * aDiffV);
}
//=======================================================================

View File

@@ -145,22 +145,18 @@ void BRepMesh_Deflection::ComputeDeflection (
}
Standard_Real aFaceDeflection = 0.0;
if (!theParameters.ForceFaceDeflection)
if (theDFace->WiresNb () > 0)
{
if (theDFace->WiresNb () > 0)
for (Standard_Integer aWireIt = 0; aWireIt < theDFace->WiresNb(); ++aWireIt)
{
for (Standard_Integer aWireIt = 0; aWireIt < theDFace->WiresNb (); ++aWireIt)
{
aFaceDeflection += theDFace->GetWire (aWireIt)->GetDeflection ();
}
aFaceDeflection /= theDFace->WiresNb ();
aFaceDeflection += theDFace->GetWire(aWireIt)->GetDeflection();
}
aFaceDeflection = Max (2. * BRepMesh_ShapeTool::MaxFaceTolerance (
theDFace->GetFace ()), aFaceDeflection);
aFaceDeflection /= theDFace->WiresNb ();
}
aFaceDeflection = Max (aDeflection, aFaceDeflection);
theDFace->SetDeflection (aFaceDeflection);
aFaceDeflection = Max(aDeflection, aFaceDeflection);
theDFace->SetDeflection (Max(2.* BRepMesh_ShapeTool::MaxFaceTolerance(
theDFace->GetFace()), aFaceDeflection));
}

View File

@@ -269,17 +269,11 @@ namespace
for (; aIntervalU <= theIntervals[0].Upper (); ++aIntervalU)
{
const Standard_Real aParamU = theIntervals[0].Value(aIntervalU);
if (Precision::IsInfinite (aParamU))
continue;
Standard_Integer aIntervalV = theIntervals[1].Lower ();
for (; aIntervalV <= theIntervals[1].Upper (); ++aIntervalV)
{
gp_Dir aNorm;
const Standard_Real aParamV = theIntervals[1].Value(aIntervalV);
if (Precision::IsInfinite (aParamV))
continue;
if (GeomLib::NormEstim (theSurf, gp_Pnt2d (aParamU, aParamV), Precision::Confusion (), aNorm) != 0)
{
return Standard_True;

View File

@@ -72,7 +72,7 @@ Standard_Real BRepMesh_ShapeTool::MaxFaceTolerance(const TopoDS_Face& theFace)
Standard_Real aMaxTolerance = BRep_Tool::Tolerance(theFace);
Standard_Real aTolerance = Max(
MaxTolerance<TopAbs_EDGE, EdgeTolerance >(theFace),
MaxTolerance<TopAbs_EDGE, EdgeTolerance >(theFace),
MaxTolerance<TopAbs_VERTEX, VertexTolerance>(theFace));
return Max(aMaxTolerance, aTolerance);

View File

@@ -1,124 +0,0 @@
// Created on: 2020-01-31
// Created by: Svetlana SHUTINA
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepPreviewAPI_MakeBox.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <TopoDS_Compound.hxx>
//=======================================================================
//function : Build
//purpose :
//=======================================================================
void BRepPreviewAPI_MakeBox::Build()
{
gp_Pnt anLocation = myWedge.Axes().Location();
gp_Pnt aFirstPoint (anLocation.X(), anLocation.Y(), anLocation.Z());
gp_Pnt aSecondPoint (anLocation.X() + myWedge.GetXMax(), anLocation.Y() + myWedge.GetYMax(), anLocation.Z() + myWedge.GetZMax());
Standard_Boolean aThinOnX = Abs (aFirstPoint.X() - aSecondPoint.X()) < Precision::Confusion();
Standard_Boolean aThinOnY = Abs (aFirstPoint.Y() - aSecondPoint.Y()) < Precision::Confusion();
Standard_Boolean aThinOnZ = Abs (aFirstPoint.Z() - aSecondPoint.Z()) < Precision::Confusion();
Standard_Integer aPreviewType = (int)aThinOnX + (int)aThinOnY + (int)aThinOnZ;
if (aPreviewType == 3) // thin box in all directions is a point
{
makeVertex (aFirstPoint);
}
else if (aPreviewType == 2) // thin box in two directions is a point
{
makeEdge (aFirstPoint, aSecondPoint);
}
// thin box in only one direction is a rectangular face
else if (aPreviewType == 1)
{
gp_Pnt aPnt1, aPnt2, aPnt3, aPnt4;
if (aThinOnX)
{
aPnt1 = gp_Pnt (aFirstPoint.X(), aFirstPoint.Y(), aFirstPoint.Z());
aPnt2 = gp_Pnt (aFirstPoint.X(), aSecondPoint.Y(), aFirstPoint.Z());
aPnt3 = gp_Pnt (aFirstPoint.X(), aSecondPoint.Y(), aSecondPoint.Z());
aPnt4 = gp_Pnt (aFirstPoint.X(), aFirstPoint.Y(), aSecondPoint.Z());
}
else if (aThinOnY)
{
aPnt1 = gp_Pnt (aFirstPoint.X(), aFirstPoint.Y(), aFirstPoint.Z());
aPnt2 = gp_Pnt (aSecondPoint.X(), aFirstPoint.Y(), aFirstPoint.Z());
aPnt3 = gp_Pnt (aSecondPoint.X(), aFirstPoint.Y(), aSecondPoint.Z());
aPnt4 = gp_Pnt (aFirstPoint.X(), aFirstPoint.Y(), aSecondPoint.Z());
}
else if (aThinOnZ)
{
aPnt1 = gp_Pnt (aFirstPoint.X(), aFirstPoint.Y(), aFirstPoint.Z());
aPnt2 = gp_Pnt (aSecondPoint.X(), aFirstPoint.Y(), aFirstPoint.Z());
aPnt3 = gp_Pnt (aSecondPoint.X(), aSecondPoint.Y(), aFirstPoint.Z());
aPnt4 = gp_Pnt (aFirstPoint.X(), aSecondPoint.Y(), aFirstPoint.Z());
}
makeRectangle (aPnt1, aPnt2, aPnt3, aPnt4);
}
if (!myShape.IsNull())
{
Done();
return;
}
// box is a valid shape
Solid();
}
//=======================================================================
//function : makeVertex
//purpose :
//=======================================================================
void BRepPreviewAPI_MakeBox::makeVertex (const gp_Pnt& thePoint)
{
myShape = BRepBuilderAPI_MakeVertex (thePoint);
}
//=======================================================================
//function : makeEdge
//purpose :
//=======================================================================
void BRepPreviewAPI_MakeBox::makeEdge (const gp_Pnt& thePoint1, const gp_Pnt& thePoint2)
{
myShape = BRepBuilderAPI_MakeEdge (thePoint1, thePoint2);
}
//=======================================================================
//function : makeRectangle
//purpose :
//=======================================================================
void BRepPreviewAPI_MakeBox::makeRectangle (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt4)
{
TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge (thePnt1, thePnt2);
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge (thePnt2, thePnt3);
TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge (thePnt3, thePnt4);
TopoDS_Edge anEdge4 = BRepBuilderAPI_MakeEdge (thePnt4, thePnt1);
BRepBuilderAPI_MakeWire aWire (anEdge1, anEdge2, anEdge3, anEdge4);
BRepBuilderAPI_MakeFace aFace (aWire);
myShape = aFace.Shape();
}

View File

@@ -1,57 +0,0 @@
// Created on: 2020-01-31
// Created by: Svetlana SHUTINA
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepPreviewAPI_MakeBox_HeaderFile
#define _BRepPreviewAPI_MakeBox_HeaderFile
#include <BRepPrimAPI_MakeBox.hxx>
//! Builds a valid box, if points fulfill the conditions of a valid box.
//! And allows to build a preview, otherwise.
//! There are 4 cases:
//! 1 - preview can be a vertex if thin box in all directions is a point;
//! 2 - preview can be an edge if thin box in two directions is a point;
//! 3 - preview can be a rectangular face if thin box in only one direction is a point;
//! 4 - preview can be a valid box if point values fulfill the conditions of a valid box.
class BRepPreviewAPI_MakeBox : public BRepPrimAPI_MakeBox
{
public:
//! Constructor
BRepPreviewAPI_MakeBox() {}
//! Creates a preview depending on point values.
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
private:
//! Create a vertex if thin box in all directions is a point.
void makeVertex (const gp_Pnt& thePoint);
//! Create an edge if thin box in two directions is a point.
void makeEdge (const gp_Pnt& thePoint1, const gp_Pnt& thePoint2);
//! Create a rectangular face if the box is thin in one direction only.
//! @param thePnt1 the first point for a rectangular face
//! @param thePnt2 the second point for a rectangular face
//! @param thePnt3 the third point for a rectangular face
//! @param thePnt4 the fourth point for a rectangular face
void makeRectangle (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt4);
};
#endif

View File

@@ -1,2 +0,0 @@
BRepPreviewAPI_MakeBox.hxx
BRepPreviewAPI_MakeBox.cxx

View File

@@ -134,27 +134,6 @@ static void BRepPrim_Wedge_Init(Standard_Boolean& S,
F[i] = Standard_False;
}
BRepPrim_GWedge::BRepPrim_GWedge() :
XMin (0),
XMax (0),
YMin (0),
YMax (0),
ZMin (0),
ZMax (0),
Z2Min (0),
Z2Max (0),
X2Min (0),
X2Max (0)
{
for (Standard_Integer i = 0; i < NBFACES; i++)
{
myInfinite[i]=Standard_False;
}
BRepPrim_Wedge_Init (ShellBuilt,VerticesBuilt,EdgesBuilt,
WiresBuilt,FacesBuilt);
}
//=======================================================================
//function : BRepPrim_GWedge
//purpose : build a box
@@ -179,7 +158,10 @@ BRepPrim_GWedge::BRepPrim_GWedge (const BRepPrim_Builder& B,
X2Max(dx)
{
for (Standard_Integer i = 0; i < NBFACES; i++) { myInfinite[i]=Standard_False; }
if ( ( dx <= Precision::Confusion() ) ||
( dy <= Precision::Confusion() ) ||
( dz <= Precision::Confusion() ) )
throw Standard_DomainError();
BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt,
WiresBuilt,FacesBuilt);
}
@@ -209,7 +191,11 @@ BRepPrim_GWedge::BRepPrim_GWedge (const BRepPrim_Builder& B,
X2Max(ltx)
{
for (Standard_Integer i = 0; i < NBFACES; i++) { myInfinite[i]=Standard_False; }
if ( ( dx <= Precision::Confusion() ) ||
( dy <= Precision::Confusion() ) ||
( dz <= Precision::Confusion() ) ||
( ltx < 0 ) )
throw Standard_DomainError();
BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt,
WiresBuilt,FacesBuilt);
}
@@ -245,7 +231,12 @@ BRepPrim_GWedge::BRepPrim_GWedge (const BRepPrim_Builder& B,
X2Max(x2max)
{
for (Standard_Integer i = 0; i < NBFACES; i++) { myInfinite[i]=Standard_False; }
if ( ( XMax-XMin <= Precision::Confusion() ) ||
( YMax-YMin <= Precision::Confusion() ) ||
( ZMax-ZMin <= Precision::Confusion() ) ||
( Z2Max-Z2Min < 0 ) ||
( X2Max-X2Min < 0 ) )
throw Standard_DomainError();
BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt,
WiresBuilt,FacesBuilt);
}
@@ -305,9 +296,6 @@ Standard_Boolean BRepPrim_GWedge::IsInfinite (const BRepPrim_Direction d1) const
//=======================================================================
const TopoDS_Shell& BRepPrim_GWedge::Shell() {
if (IsDegeneratedShape())
throw Standard_DomainError();
if (!ShellBuilt) {
myBuilder.MakeShell(myShell);
@@ -1032,19 +1020,3 @@ const TopoDS_Vertex& BRepPrim_GWedge::Vertex
}
//=======================================================================
//function : IsDegeneratedShape
//purpose :
//=======================================================================
Standard_Boolean BRepPrim_GWedge::IsDegeneratedShape()
{
if ( ( XMax-XMin <= Precision::Confusion() ) ||
( YMax-YMin <= Precision::Confusion() ) ||
( ZMax-ZMin <= Precision::Confusion() ) ||
( Z2Max-Z2Min < 0 ) ||
( X2Max-X2Min < 0 ) )
return Standard_True;
else
return Standard_False;
}

View File

@@ -70,8 +70,6 @@ public:
DEFINE_STANDARD_ALLOC
//! Default constructor
Standard_EXPORT BRepPrim_GWedge();
//! Creates a GWedge algorithm. <Axes> is the axis
//! system for the primitive.
@@ -193,9 +191,7 @@ public:
//! <d1><d2><d3> direction.
Standard_EXPORT gp_Pnt Point (const BRepPrim_Direction d1, const BRepPrim_Direction d2, const BRepPrim_Direction d3);
//! Checkes a shape on degeneracy
//! @return TRUE if a shape is degenerated
Standard_EXPORT Standard_Boolean IsDegeneratedShape();
protected:

View File

@@ -34,9 +34,7 @@ public:
DEFINE_STANDARD_ALLOC
//! Default constructor
BRepPrim_Wedge() {}
//! Creates a Wedge algorithm. <Axes> is the axis
//! system for the primitive.
//!

View File

@@ -102,56 +102,6 @@ BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const gp_Ax2& Axes,
{
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepPrimAPI_MakeBox::Init (const Standard_Real theDX, const Standard_Real theDY, const Standard_Real theDZ)
{
myWedge = BRepPrim_Wedge (gp_Ax2 (pmin (gp_Pnt (0, 0, 0), theDX, theDY, theDZ), gp_Dir (0, 0, 1), gp_Dir (1, 0, 0)),
Abs (theDX), Abs (theDY), Abs (theDZ));
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepPrimAPI_MakeBox::Init (const gp_Pnt& thePnt,
const Standard_Real theDX,
const Standard_Real theDY,
const Standard_Real theDZ)
{
myWedge = BRepPrim_Wedge (gp_Ax2 (pmin (thePnt, theDX, theDY, theDZ), gp_Dir (0, 0, 1), gp_Dir (1, 0, 0)),
Abs (theDX), Abs (theDY), Abs (theDZ));
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepPrimAPI_MakeBox::Init (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2)
{
myWedge = BRepPrim_Wedge (gp_Ax2 (pmin (thePnt1,thePnt2), gp_Dir (0, 0, 1), gp_Dir (1, 0, 0)),
Abs (thePnt2.X() - thePnt1.X()),
Abs (thePnt2.Y() - thePnt1.Y()),
Abs (thePnt2.Z() - thePnt1.Z()));
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepPrimAPI_MakeBox::Init (const gp_Ax2& theAxes,
const Standard_Real theDX,
const Standard_Real theDY,
const Standard_Real theDZ)
{
myWedge = BRepPrim_Wedge (theAxes, theDX, theDY, theDZ);
}
//=======================================================================
//function : Wedge

View File

@@ -40,29 +40,12 @@ class TopoDS_Face;
//! - defining the construction of a box,
//! - implementing the construction algorithm, and
//! - consulting the result.
//! Constructs a box such that its sides are parallel to the axes of
//! - the global coordinate system, or
//! - the local coordinate system Axis. and
//! - with a corner at (0, 0, 0) and of size (dx, dy, dz), or
//! - with a corner at point P and of size (dx, dy, dz), or
//! - with corners at points P1 and P2.
//! Exceptions
//! Standard_DomainError if: dx, dy, dz are less than or equal to
//! Precision::Confusion(), or
//! - the vector joining the points P1 and P2 has a
//! component projected onto the global coordinate
//! system less than or equal to Precision::Confusion().
//! In these cases, the box would be flat.
class BRepPrimAPI_MakeBox : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Default constructor
BRepPrimAPI_MakeBox() {}
//! Make a box with a corner at 0,0,0 and the other dx,dy,dz
Standard_EXPORT BRepPrimAPI_MakeBox(const Standard_Real dx, const Standard_Real dy, const Standard_Real dz);
@@ -73,27 +56,22 @@ public:
//! Make a box with corners P1,P2.
Standard_EXPORT BRepPrimAPI_MakeBox(const gp_Pnt& P1, const gp_Pnt& P2);
//! Make a box with Ax2 (the left corner and the axis) and size dx, dy, dz.
//! Ax2 is the left corner and the axis.
//! Constructs a box such that its sides are parallel to the axes of
//! - the global coordinate system, or
//! - the local coordinate system Axis. and
//! - with a corner at (0, 0, 0) and of size (dx, dy, dz), or
//! - with a corner at point P and of size (dx, dy, dz), or
//! - with corners at points P1 and P2.
//! Exceptions
//! Standard_DomainError if: dx, dy, dz are less than or equal to
//! Precision::Confusion(), or
//! - the vector joining the points P1 and P2 has a
//! component projected onto the global coordinate
//! system less than or equal to Precision::Confusion().
//! In these cases, the box would be flat.
Standard_EXPORT BRepPrimAPI_MakeBox(const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz);
//! Init a box with a corner at 0,0,0 and the other theDX, theDY, theDZ
Standard_EXPORT void Init (const Standard_Real theDX, const Standard_Real theDY, const Standard_Real theDZ);
//! Init a box with a corner at thePnt and size theDX, theDY, theDZ.
Standard_EXPORT void Init (const gp_Pnt& thePnt,
const Standard_Real theDX,
const Standard_Real theDY,
const Standard_Real theDZ);
//! Init a box with corners thePnt1, thePnt2.
Standard_EXPORT void Init (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2);
//! Init a box with Ax2 (the left corner and the theAxes) and size theDX, theDY, theDZ.
Standard_EXPORT void Init (const gp_Ax2& theAxes,
const Standard_Real theDX,
const Standard_Real theDY,
const Standard_Real theDZ);
//! Returns the internal algorithm.
Standard_EXPORT BRepPrim_Wedge& Wedge();
@@ -132,7 +110,6 @@ Standard_EXPORT operator TopoDS_Solid();
protected:
BRepPrim_Wedge myWedge;
@@ -140,6 +117,7 @@ private:
BRepPrim_Wedge myWedge;
};

View File

@@ -523,10 +523,8 @@ TopoDS_Shape BRepSweep_NumLinearRegularSweep::SplitShell(const TopoDS_Shape& aNe
Standard_Boolean BRepSweep_NumLinearRegularSweep::IsUsed(const TopoDS_Shape& aGenS) const
{
Standard_Integer iGenS = myGenShapeTool.Index(aGenS);
if (iGenS == 0)
{
return Standard_False;
}
Standard_OutOfRange_Raise_if(iGenS == 0,
"BRepSweep_NumLinearRegularSweep::IsUsed: shape index = 0")
Standard_Integer j;
Standard_Boolean isBuilt = Standard_False;
Standard_Boolean isUsed = Standard_False;
@@ -578,10 +576,8 @@ Standard_Boolean BRepSweep_NumLinearRegularSweep::IsUsed(const TopoDS_Shape& aGe
Standard_Boolean BRepSweep_NumLinearRegularSweep::GenIsUsed(const TopoDS_Shape& aGenS) const
{
Standard_Integer iGenS = myGenShapeTool.Index(aGenS);
if (iGenS == 0)
{
return Standard_False;
}
Standard_OutOfRange_Raise_if(iGenS == 0,
"BRepSweep_NumLinearRegularSweep::GenIsUsed: shape index = 0")
if (iGenS == 1)
{
return myBuiltShapes(iGenS, 1);

View File

@@ -22,7 +22,6 @@
#include <TopoDS_Solid.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI.hxx>
#include <BRepPreviewAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeWedge.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
@@ -40,153 +39,28 @@
static Standard_Integer box(Draw_Interpretor& , Standard_Integer n, const char** a)
{
gp_Pnt anOrigin;
gp_XYZ aParams;
gp_Dir aDir;
gp_Dir aXDir;
Standard_Boolean isMinMax = Standard_False;
Standard_Boolean isPreview = Standard_False;
Standard_Boolean isAxis = Standard_False;
if (n < 5) return 1;
Standard_Real dx = Draw::Atof(a[n-3]);
Standard_Real dy = Draw::Atof(a[n-2]);
Standard_Real dz = Draw::Atof(a[n-1]);
for (Standard_Integer anArgIter = 2; anArgIter < n; ++anArgIter)
{
TCollection_AsciiString anArgCase (a[anArgIter]);
anArgCase.LowerCase();
if (anArgCase == "-min" && anArgIter + 3 <= n)
{
anOrigin.SetX (Draw::Atof(a[anArgIter + 1]));
anOrigin.SetY (Draw::Atof(a[anArgIter + 2]));
anOrigin.SetZ (Draw::Atof(a[anArgIter + 3]));
anArgIter += 3;
}
else if (anArgCase == "-max" && anArgIter + 3 <= n)
{
aParams.SetX (Draw::Atof(a[anArgIter + 1]));
aParams.SetY (Draw::Atof(a[anArgIter + 2]));
aParams.SetZ (Draw::Atof(a[anArgIter + 3]));
isMinMax = Standard_True;
anArgIter += 3;
}
else if (anArgCase == "-size" && anArgIter + 3 <= n)
{
aParams.SetX (Draw::Atof(a[anArgIter + 1]));
aParams.SetY (Draw::Atof(a[anArgIter + 2]));
aParams.SetZ (Draw::Atof(a[anArgIter + 3]));
isMinMax = Standard_False;
anArgIter += 3;
}
else if (anArgCase == "-dir" && anArgIter + 3 <= n)
{
Standard_Real aX = Draw::Atof(a[anArgIter + 1]);
Standard_Real anY = Draw::Atof(a[anArgIter + 2]);
Standard_Real aZ = Draw::Atof(a[anArgIter + 3]);
aDir.SetCoord (aX, anY, aZ);
isAxis = Standard_True;
anArgIter += 3;
}
else if (anArgCase == "-xdir" && anArgIter + 3 <= n)
{
Standard_Real aX = Draw::Atof(a[anArgIter + 1]);
Standard_Real anY = Draw::Atof(a[anArgIter + 2]);
Standard_Real aZ = Draw::Atof(a[anArgIter + 3]);
aXDir.SetCoord (aX, anY, aZ);
isAxis = Standard_True;
anArgIter += 3;
}
else if (anArgCase == "-preview")
{
isPreview = Standard_True;
}
else if (anArgIter + 5 < n || anArgIter + 2 < n)
{
Standard_Real aValue = 0.0;
Standard_Integer aCountReal = 0;
Standard_Integer anIter = anArgIter;
while (anIter < n && Draw::ParseReal(a[anIter], aValue))
{
anIter++;
aCountReal++;
}
TopoDS_Solid S;
if (aCountReal == 6)
{
anOrigin.SetX (Draw::Atof(a[anArgIter]));
anOrigin.SetY (Draw::Atof(a[anArgIter + 1]));
anOrigin.SetZ (Draw::Atof(a[anArgIter + 2]));
aParams.SetX (Draw::Atof(a[anArgIter + 3]));
aParams.SetY (Draw::Atof(a[anArgIter + 4]));
aParams.SetZ (Draw::Atof(a[anArgIter + 5]));
anArgIter += 5;
}
else if (aCountReal == 3)
{
aParams.SetX (Draw::Atof(a[anArgIter]));
aParams.SetY (Draw::Atof(a[anArgIter + 1]));
aParams.SetZ (Draw::Atof(a[anArgIter + 2]));
anArgIter += 2;
}
else
{
std::cout<<"Syntax error\n";
return 1;
}
}
if (n > 5) {
if (n < 8) return 1;
Standard_Real x = Draw::Atof(a[2]);
Standard_Real y = Draw::Atof(a[3]);
Standard_Real z = Draw::Atof(a[4]);
S = BRepPrimAPI_MakeBox(gp_Pnt(x,y,z),dx,dy,dz);
}
else {
S = BRepPrimAPI_MakeBox(dx,dy,dz);
}
if (isPreview)
{
TopoDS_Shape S;
BRepPreviewAPI_MakeBox aPreview;
if (isMinMax == Standard_True)
{
aPreview.Init (anOrigin, aParams);
}
else if (isMinMax == Standard_False && isAxis == Standard_False)
{
aPreview.Init (anOrigin, aParams.X(), aParams.Y(), aParams.Z());
}
else if (isAxis)
{
gp_Ax2 anAxis (anOrigin, aDir, aXDir);
aPreview.Init (anAxis, aParams.X(), aParams.Y(), aParams.Z());
}
else
{
aPreview.Init (aParams.X(), aParams.Y(), aParams.Z());
}
S = aPreview;
DBRep::Set(a[1],S);
}
else
{
TopoDS_Solid S;
if (isMinMax == Standard_True)
{
S = BRepPrimAPI_MakeBox(anOrigin, aParams);
}
else if (isMinMax == Standard_False && isAxis == Standard_False)
{
S = BRepPrimAPI_MakeBox(anOrigin, aParams.X(), aParams.Y(), aParams.Z());
}
else if (isAxis)
{
gp_Ax2 anAxis (anOrigin, aDir, aXDir);
S = BRepPrimAPI_MakeBox(anAxis, aParams.X(), aParams.Y(), aParams.Z());
}
else
{
S = BRepPrimAPI_MakeBox(aParams.X(), aParams.Y(), aParams.Z());
}
DBRep::Set(a[1],S);
}
DBRep::Set(a[1],S);
return 0;
}
//=======================================================================
// wedge
//=======================================================================
@@ -400,20 +274,7 @@ void BRepTest::PrimitiveCommands(Draw_Interpretor& theCommands)
const char* g = "Primitive building commands";
theCommands.Add ("box",
"box name [dx dy dz] [x y z dx dy dz]"
"\n\t\t: [-min x y z] [-size dx dy dz] [-max x y z]"
"\n\t\t: [-dir x y z -xdir x y z] [-preview]"
"\n\t\t: Construct axes-aligned box and put result into 'name' variable"
"\n\t\t: -min box lower corner, origin; (0,0,0) by default"
"\n\t\t: -size box dimensions (alternative to -max)"
"\n\t\t: -max box upper corner (alternative to -size)"
"\n\t\t: -dir main direction of coordinate system (DZ by default)"
"\n\t\t: -xdir x direction of coordinate system (DX by default)"
"\n\t\t: -preview non-solid shape will be created (vertex, edge, rectangle or box);"
"\n\t\t: otherwise, return NULL shape in case of zero box dimension.",
__FILE__,box,g);
theCommands.Add("box","box name [x1 y1 z1] dx dy dz",__FILE__,box,g);
theCommands.Add("wedge","wedge name [Ox Oy Oz Zx Zy Zz Xx Xy Xz] dx dy dz ltx / xmin zmin xmax zmax",__FILE__,wedge,g);
theCommands.Add("pcylinder","pcylinder name [plane(ax2)] R H [angle]",__FILE__,cylinder,g);

View File

@@ -482,8 +482,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
}
return Standard_True;
}
//
GeomAdaptor_Surface GAS(S,Uinf-u,Usup+u,Vinf-v,Vsup+v);
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(GAS);
@@ -492,19 +490,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
if(ProjOnCurve.IsDone()) {
Curve2d = ProjOnCurve.BSpline();
if (S->IsUPeriodic() || S->IsVPeriodic())
{
//Surface is periodic, checking curve2d domain
//Old domain
gp_Pnt2d aPf = C2d->Value(f2d);
//New domain
gp_Pnt2d aNewPf = Curve2d->Value(f2d);
gp_Vec2d aT(aNewPf, aPf);
if (aT.SquareMagnitude() > Precision::SquarePConfusion())
{
Curve2d = Handle(Geom2d_Curve)::DownCast(Curve2d->Translated(aT));
}
}
Standard_Real newTol = BRepTools::EvalAndUpdateTol(newE, C3d, Curve2d, S, f3d, l3d);
if(newTol > Tol)
{

View File

@@ -18,9 +18,8 @@
#include <BVH_Constants.hxx>
#include <BVH_Types.hxx>
#include <Standard_Macro.hxx>
#include <Standard_Dump.hxx>
#include <Standard_ShortReal.hxx>
#include <Standard_Dump.hxx>
#include <limits>
@@ -184,27 +183,11 @@ public:
T Center (const Standard_Integer theAxis) const;
//! Dumps the content of me into the stream
void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const
{
(void)theDepth;
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInited)
int n = Min (N, 3);
if (n == 1)
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMinPoint[0])
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMinPoint[0])
}
if (n == 2)
{
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "MinPoint", n, myMinPoint[0], myMinPoint[1])
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "MaxPoint", n, myMaxPoint[0], myMaxPoint[1])
}
if (n == 3)
{
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "MinPoint", n, myMinPoint[0], myMinPoint[1], myMinPoint[2])
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "MaxPoint", n, myMaxPoint[0], myMaxPoint[1], myMaxPoint[2])
}
OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_Box);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsValid());
}
public:

View File

@@ -269,7 +269,7 @@ public: //! @name Ray-Box Intersection
T aTimeEnter = Max (aTimeMin[0], Max (aTimeMin[1], aTimeMin[2]));
T aTimeLeave = Min (aTimeMax[0], Min (aTimeMax[1], aTimeMax[2]));
Standard_Boolean hasIntersection = aTimeEnter <= aTimeLeave && aTimeLeave >= 0;
Standard_Boolean hasIntersection = aTimeEnter < aTimeLeave && aTimeLeave > 0;
if (hasIntersection)
{
theTimeEnter = aTimeEnter;

View File

@@ -29,10 +29,10 @@ protected:
BVH_TreeBaseTransient() {}
//! Dumps the content of me into the stream
virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const { (void)theOStream; (void)theDepth; }
virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const { (void)theOStream; (void)theDepth; }
//! Dumps the content of me into the stream
virtual void DumpNode (const int theNodeIndex, Standard_OStream& theOStream, Standard_Integer theDepth) const
virtual void DumpNode (const int theNodeIndex, Standard_OStream& theOStream, const Standard_Integer theDepth) const
{ (void)theNodeIndex; (void)theOStream; (void)theDepth; }
};
@@ -186,11 +186,11 @@ public: //! @name methods for accessing serialized tree data
}
//! Dumps the content of me into the stream
virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDepth)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Length())
OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_TreeBase);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDepth);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Length());
for (Standard_Integer aNodeIdx = 0; aNodeIdx < Length(); ++aNodeIdx)
{
@@ -199,20 +199,20 @@ public: //! @name methods for accessing serialized tree data
}
//! Dumps the content of node into the stream
virtual void DumpNode (const int theNodeIndex, Standard_OStream& theOStream, Standard_Integer theDepth) const Standard_OVERRIDE
virtual void DumpNode (const int theNodeIndex, Standard_OStream& theOStream, const Standard_Integer theDepth) const Standard_OVERRIDE
{
OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_TreeNode)
OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_TreeNode);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, theNodeIndex)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, theNodeIndex);
Bnd_Box aBndBox = BVH::ToBndBox (MinPoint (theNodeIndex), MaxPoint (theNodeIndex));
Bnd_Box* aPointer = &aBndBox;
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aPointer)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aPointer);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, BegPrimitive (theNodeIndex))
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, EndPrimitive (theNodeIndex))
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Level (theNodeIndex))
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsOuter (theNodeIndex))
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, BegPrimitive (theNodeIndex));
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, EndPrimitive (theNodeIndex));
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Level (theNodeIndex));
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsOuter (theNodeIndex));
}
public: //! @name protected fields

View File

@@ -204,7 +204,6 @@ void BinMDataStd_NamedDataDriver::Paste(const Handle(TDF_Attribute)& theSource,
if(S.IsNull()) return;
// Standard_Integer i=0;
S->LoadDeferredData();
if(S->HasIntegers() && !S->GetIntegersContainer().IsEmpty()) {
theTarget.PutInteger(1) << S->GetIntegersContainer().Extent(); //dim
TColStd_DataMapIteratorOfDataMapOfStringInteger itr(S->GetIntegersContainer());

View File

@@ -163,10 +163,12 @@ Standard_Boolean BinMXCAFDoc_VisMaterialDriver::Paste (const BinObjMgt_Persisten
aMat->SetDoubleSided (isDoubleSided == '1');
aMat->SetAlphaMode (alphaModeFromChar (anAlphaMode), anAlphaCutOff);
XCAFDoc_VisMaterialPBR aPbrMat;
theSource.GetBoolean (aPbrMat.IsDefined);
if (aPbrMat.IsDefined)
bool hasPbrMat = false;
theSource.GetBoolean (hasPbrMat);
if (hasPbrMat)
{
XCAFDoc_VisMaterialPBR aPbrMat;
aPbrMat.IsDefined = true;
readColor (theSource, aPbrMat.BaseColor);
readVec3 (theSource, aPbrMat.EmissiveFactor);
theSource.GetShortReal (aPbrMat.Metallic);
@@ -194,22 +196,6 @@ Standard_Boolean BinMXCAFDoc_VisMaterialDriver::Paste (const BinObjMgt_Persisten
readTexture (theSource, aComMat.DiffuseTexture);
aMat->SetCommonMaterial (aComMat);
}
if (aVerMaj > MaterialVersionMajor_1
|| (aVerMaj == MaterialVersionMajor_1
&& aVerMin >= MaterialVersionMinor_1))
{
if (aPbrMat.IsDefined)
{
theSource.GetShortReal (aPbrMat.RefractionIndex);
}
}
if (aPbrMat.IsDefined)
{
aMat->SetPbrMaterial (aPbrMat);
}
return Standard_True;
}
@@ -256,9 +242,4 @@ void BinMXCAFDoc_VisMaterialDriver::Paste (const Handle(TDF_Attribute)& theSourc
theTarget.PutShortReal (aComMat.Transparency);
writeTexture (theTarget, aComMat.DiffuseTexture);
}
if (aMat->HasPbrMaterial())
{
theTarget.PutShortReal (aMat->PbrMaterial().RefractionIndex);
}
}

View File

@@ -27,15 +27,7 @@ class BinMXCAFDoc_VisMaterialDriver : public BinMDF_ADriver
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_VisMaterialDriver, BinMDF_ADriver)
//! Persistence version (major for breaking changes, minor for adding new fields at end).
enum
{
MaterialVersionMajor_1 = 1,
MaterialVersionMinor_0 = 0,
MaterialVersionMinor_1 = 1, //!< added IOR
MaterialVersionMajor = MaterialVersionMajor_1,
MaterialVersionMinor = MaterialVersionMinor_1
};
enum { MaterialVersionMajor = 1, MaterialVersionMinor = 0 };
public:
//! Main constructor.

View File

@@ -975,11 +975,13 @@ void Bnd_Box::Dump () const
//function : DumpJson
//purpose :
//=======================================================================
void Bnd_Box::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
void Bnd_Box::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_Box);
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "CornerMin", 3, Xmin, Ymin, Zmin)
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "CornerMax", 3, Xmax, Ymax, Zmax)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Gap)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Flags)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Gap);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Flags);
}

View File

@@ -303,7 +303,7 @@ public:
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
protected:

View File

@@ -1027,17 +1027,17 @@ void Bnd_OBB::Add(const Bnd_OBB& theOther)
//function : DumpJson
//purpose :
//=======================================================================
void Bnd_OBB::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
void Bnd_OBB::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_OBB)
OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_OBB);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCenter)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[0])
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[1])
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[2])
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCenter);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[0]);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[1]);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[2]);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[0])
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[1])
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[2])
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsAABox)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[0]);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[1]);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[2]);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsAABox);
}

View File

@@ -283,7 +283,7 @@ public:
Standard_EXPORT void Add(const gp_Pnt& theP);
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
protected:

View File

@@ -181,10 +181,10 @@ void Bnd_Range::Split(const Standard_Real theVal,
// function : DumpJson
// purpose :
// =======================================================================
void Bnd_Range::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
void Bnd_Range::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_Range)
OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_Range);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirst)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLast)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirst);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLast);
}

View File

@@ -257,7 +257,7 @@ public:
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
private:

View File

@@ -20,7 +20,6 @@
#include <CDM_MetaData.hxx>
#include <CDM_Reference.hxx>
#include <Resource_Manager.hxx>
#include <Standard_Dump.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Message.hxx>
@@ -127,12 +126,3 @@ TCollection_AsciiString CDM_Application::Version() const
// Default: empty
return TCollection_AsciiString();
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void CDM_Application::DumpJson (Standard_OStream& theOStream, Standard_Integer /*theDepth*/) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
}

View File

@@ -66,9 +66,6 @@ public:
//! Returns the application version.
Standard_EXPORT virtual TCollection_AsciiString Version() const;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
friend class CDM_Reference;
friend class CDM_MetaData;

View File

@@ -28,7 +28,6 @@
#include <CDM_ReferenceIterator.hxx>
#include <Resource_Manager.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_Dump.hxx>
#include <Standard_Failure.hxx>
#include <Standard_GUID.hxx>
#include <Standard_NoSuchObject.hxx>
@@ -1285,54 +1284,3 @@ void CDM_Document::ChangeStorageFormatVersion(const Standard_Integer theVersion)
{
myStorageFormatVersion = theVersion;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void CDM_Document::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
for (TColStd_SequenceOfExtendedString::Iterator aCommentIt (myComments); aCommentIt.More(); aCommentIt.Next())
{
const TCollection_ExtendedString& aComment = aCommentIt.Value();
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aComment)
}
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myPresentation)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myValidPresentation)
for (CDM_ListOfReferences::Iterator aFromReferenceIt (myFromReferences); aFromReferenceIt.More(); aFromReferenceIt.Next())
{
const Handle(CDM_Reference)& aFromReference = aFromReferenceIt.Value().get();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aFromReference.get())
}
for (CDM_ListOfReferences::Iterator aToReferenceIt (myToReferences); aToReferenceIt.More(); aToReferenceIt.Next())
{
const Handle(CDM_Reference)& aToReference = aToReferenceIt.Value().get();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aToReference.get())
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVersion)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myActualReferenceIdentifier)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myStorageVersion)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myMetaData.get())
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myRequestedComment)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myRequestedFolder)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRequestedFolderIsDefined)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myRequestedName)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRequestedNameIsDefined)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRequestedPreviousVersionIsDefined)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myRequestedPreviousVersion)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myFileExtension)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myDescription)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFileExtensionWasFound)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDescriptionWasFound)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myApplication.get())
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myStorageFormatVersion)
}

View File

@@ -349,9 +349,6 @@ Standard_OStream& operator << (Standard_OStream& anOStream);
//! Sets <theVersion> of the format to be used to store the document
Standard_EXPORT void ChangeStorageFormatVersion(const Standard_Integer theVersion);
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
friend class CDM_Reference;
friend class CDM_ReferenceIterator;
friend class CDM_Application;

View File

@@ -20,7 +20,6 @@
#include <CDM_MetaData.hxx>
#include <CDM_MetaDataLookUpTable.hxx>
#include <CDM_Reference.hxx>
#include <Standard_Dump.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
@@ -145,24 +144,3 @@ void CDM_MetaData::SetIsReadOnly() {
void CDM_MetaData::UnsetIsReadOnly() {
myIsReadOnly=Standard_False;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void CDM_MetaData::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRetrieved)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDocument)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myFolder)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myVersion)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasVersion)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myFileName)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myPath)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDocumentVersion)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsReadOnly)
}

View File

@@ -84,9 +84,6 @@ Standard_OStream& operator << (Standard_OStream& anOStream);
Standard_EXPORT void SetIsReadOnly();
Standard_EXPORT void UnsetIsReadOnly();
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
friend class CDM_Reference;

View File

@@ -19,7 +19,6 @@
#include <CDM_Document.hxx>
#include <CDM_MetaData.hxx>
#include <CDM_Reference.hxx>
#include <Standard_Dump.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(CDM_Reference,Standard_Transient)
@@ -121,23 +120,3 @@ Standard_Boolean CDM_Reference::IsInSession() const {
Standard_Boolean CDM_Reference::IsStored() const {
return !myMetaData.IsNull();
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void CDM_Reference::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myToDocument.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myFromDocument)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myReferenceIdentifier)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myApplication.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myMetaData.get())
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDocumentVersion)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUseStorageConfiguration)
}

View File

@@ -48,9 +48,6 @@ public:
Standard_EXPORT Standard_Integer DocumentVersion() const;
Standard_EXPORT Standard_Boolean IsReadOnly() const;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
friend class CDM_Document;

View File

@@ -100,10 +100,6 @@
#include <TDataStd_ReferenceList.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
#include <TDataStd_ListIteratorOfListOfExtendedString.hxx>
#include <algorithm>
#include <vector>
#define MAXLENGTH 10
//#define DEB_DDataStd
@@ -3206,7 +3202,6 @@ static Standard_Integer DDataStd_SetNDataIntegers2 (Draw_Interpretor& di,
j = 1111;
TCollection_ExtendedString aKey("Key_");
anAtt->LoadDeferredData();
for(Standard_Integer i = 1; i<=aNumP; i++) {
TCollection_ExtendedString key = aKey + i;
Standard_Integer aVal = j+i;
@@ -3252,7 +3247,6 @@ static Standard_Integer DDataStd_SetNDataIntAr2 (Draw_Interpretor& di,
anArr->SetValue(i, aVal);
j++;
}
anAtt->LoadDeferredData();
anAtt->SetArrayOfIntegers(aKey, anArr);
return 0;
}
@@ -3369,7 +3363,6 @@ static Standard_Integer DDataStd_SetNDataIntegers (Draw_Interpretor& di,
return 1;}
j = 4;
anAtt->LoadDeferredData();
for(Standard_Integer i = 1; i<=aNumP; i++) {
TCollection_ExtendedString aKey(arg[j]);
Standard_Integer aVal = Draw::Atoi(arg[j+1]);
@@ -3404,14 +3397,13 @@ static Standard_Integer DDataStd_GetNDIntegers (Draw_Interpretor& di,
return 1;}
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
const TColStd_DataMapOfStringInteger& aMap = anAtt->GetIntegersContainer();
TColStd_DataMapIteratorOfDataMapOfStringInteger itr(aMap);
for (; itr.More(); itr.Next()){
TCollection_ExtendedString aKey(itr.Key());
TCollection_AsciiString aStr(aKey,'?');
Standard_Integer aValue = itr.Value();
di << "Key = " << aStr.ToCString() << " Value = " << aValue << "\n";
std::cout << "Key = " << aStr.ToCString() << " Value = " <<aValue<<std::endl;
}
return 0;
@@ -3442,7 +3434,6 @@ static Standard_Integer DDataStd_GetNDInteger (Draw_Interpretor& di,
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
if(!anAtt->HasInteger(arg[3])) {
std::cout << "There is no data specified by Key = "<< arg[3] << std::endl;
return 1;
@@ -3482,7 +3473,6 @@ static Standard_Integer DDataStd_SetNDataReals (Draw_Interpretor& di,
return 1;}
j = 4;
anAtt->LoadDeferredData();
for(Standard_Integer i = 1; i<=aNumP; i++) {
TCollection_ExtendedString aKey(arg[j]);
Standard_Real aVal = Draw::Atof(arg[j+1]);
@@ -3516,14 +3506,13 @@ static Standard_Integer DDataStd_GetNDReals (Draw_Interpretor& di,
std::cout << "NamedData attribute is not found or not set" << std::endl;
return 1;}
anAtt->LoadDeferredData();
const TDataStd_DataMapOfStringReal& aMap = anAtt->GetRealsContainer();
TDataStd_DataMapIteratorOfDataMapOfStringReal itr(aMap);
for (; itr.More(); itr.Next()){
TCollection_ExtendedString aKey(itr.Key());
TCollection_AsciiString aStr(aKey,'?');
Standard_Real aValue = itr.Value();
di << "Key = " << aStr.ToCString() << " Value = " << aValue << "\n";
std::cout << "Key = " << aStr.ToCString() << " Value = " <<aValue<<std::endl;
}
return 0;
}
@@ -3553,7 +3542,6 @@ static Standard_Integer DDataStd_GetNDReal (Draw_Interpretor& di,
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
if(!anAtt->HasReal(arg[3])) {
std::cout << "There is no data specified by Key = "<< arg[3] << std::endl;
return 1;
@@ -3593,7 +3581,6 @@ static Standard_Integer DDataStd_SetNDataStrings (Draw_Interpretor& di,
return 1;}
j = 4;
anAtt->LoadDeferredData();
for(Standard_Integer i = 1; i<=aNumP; i++) {
TCollection_ExtendedString aKey(arg[j]);
TCollection_ExtendedString aVal(arg[j+1]);
@@ -3609,19 +3596,6 @@ static Standard_Integer DDataStd_SetNDataStrings (Draw_Interpretor& di,
//=======================================================================
//function : GetNDStrings(DF, entry )
//=======================================================================
namespace
{
typedef std::pair<TCollection_ExtendedString, TCollection_ExtendedString>
DDataStd_GetNDStrings_Property;
bool isLess(
const DDataStd_GetNDStrings_Property& theProperty1,
const DDataStd_GetNDStrings_Property& theProperty2)
{
return theProperty1.first.IsLess(theProperty2.first);
}
}
static Standard_Integer DDataStd_GetNDStrings (Draw_Interpretor& di,
Standard_Integer nb,
const char** arg)
@@ -3640,22 +3614,16 @@ static Standard_Integer DDataStd_GetNDStrings (Draw_Interpretor& di,
return 1;}
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
const TDataStd_DataMapOfStringString& aMap = anAtt->GetStringsContainer();
std::vector<DDataStd_GetNDStrings_Property> aProperties;
for (TDataStd_DataMapIteratorOfDataMapOfStringString aIt (aMap); aIt.More(); aIt.Next())
{
aProperties.push_back(DDataStd_GetNDStrings_Property (aIt.Key(), aIt.Value()));
}
std::sort (aProperties.begin(), aProperties.end(), isLess);
for (std::vector<DDataStd_GetNDStrings_Property>::size_type aI = 0; aI < aProperties.size(); ++aI)
{
di << "Key = " << aProperties[aI].first << " Value = " << aProperties[aI].second << "\n";
}
return 0;
TDataStd_DataMapIteratorOfDataMapOfStringString itr(aMap);
for (; itr.More(); itr.Next()){
TCollection_ExtendedString aKey(itr.Key());
TCollection_AsciiString aStr(aKey,'?');
TCollection_ExtendedString aVal(itr.Value());
TCollection_AsciiString aStrValue(aVal,'?');
std::cout << "Key = " << aStr.ToCString() << " Value = " <<aStrValue.ToCString()<< std::endl;
}
return 0;
}
di << "DDataStd_GetNDStrings : Error\n";
return 1;
@@ -3683,7 +3651,6 @@ static Standard_Integer DDataStd_GetNDString (Draw_Interpretor& di,
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
if(!anAtt->HasString(arg[3])) {
std::cout << "There is no data specified by Key = "<< arg[3] << std::endl;
return 1;
@@ -3724,7 +3691,6 @@ static Standard_Integer DDataStd_SetNDataBytes (Draw_Interpretor& di,
return 1;}
j = 4;
anAtt->LoadDeferredData();
for(Standard_Integer i = 1; i<=aNumP; i++) {
TCollection_ExtendedString aKey(arg[j]);
Standard_Byte aVal = (Standard_Byte)Draw::Atoi(arg[j+1]);
@@ -3758,7 +3724,6 @@ static Standard_Integer DDataStd_GetNDBytes (Draw_Interpretor& di,
return 1;}
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
const TDataStd_DataMapOfStringByte& aMap = anAtt->GetBytesContainer();
TDataStd_DataMapIteratorOfDataMapOfStringByte itr(aMap);
for (; itr.More(); itr.Next()){
@@ -3795,7 +3760,6 @@ static Standard_Integer DDataStd_GetNDByte (Draw_Interpretor& di,
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
if(!anAtt->HasByte(arg[3])) {
std::cout << "There is no data specified by Key = "<< arg[3] << std::endl;
return 1;
@@ -3843,7 +3807,6 @@ static Standard_Integer DDataStd_SetNDataIntAr (Draw_Interpretor& di,
anArr->SetValue(i, aVal);
j++;
}
anAtt->LoadDeferredData();
anAtt->SetArrayOfIntegers(aKey, anArr);
return 0;
}
@@ -3873,7 +3836,6 @@ static Standard_Integer DDataStd_GetNDIntArrays (Draw_Interpretor& di,
return 1;}
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
const TDataStd_DataMapOfStringHArray1OfInteger& aMap = anAtt->GetArraysOfIntegersContainer();
TDataStd_DataMapIteratorOfDataMapOfStringHArray1OfInteger itr(aMap);
for (; itr.More(); itr.Next()){
@@ -3919,7 +3881,6 @@ static Standard_Integer DDataStd_GetNDIntArray (Draw_Interpretor& di,
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
if(!anAtt->HasArrayOfIntegers(arg[3])) {
std::cout << "There is no data specified by Key = "<< arg[3] << std::endl;
return 1;
@@ -3976,7 +3937,6 @@ static Standard_Integer DDataStd_SetNDataRealAr (Draw_Interpretor& di,
anArr->SetValue(i, aVal);
j++;
}
anAtt->LoadDeferredData();
anAtt->SetArrayOfReals(aKey, anArr);
return 0;
}
@@ -4006,7 +3966,6 @@ static Standard_Integer DDataStd_GetNDRealArrays (Draw_Interpretor& di,
return 1;}
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
const TDataStd_DataMapOfStringHArray1OfReal& aMap = anAtt->GetArraysOfRealsContainer();
TDataStd_DataMapIteratorOfDataMapOfStringHArray1OfReal itr(aMap);
for (; itr.More(); itr.Next()){
@@ -4051,8 +4010,7 @@ static Standard_Integer DDataStd_GetNDRealArray (Draw_Interpretor& di,
return 1;}
std::cout <<std::endl;
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
anAtt->LoadDeferredData();
std::cout <<"NamedData attribute at Label = " << arg[2] <<std::endl;
if(!anAtt->HasArrayOfReals(arg[3])) {
std::cout << "There is no data specified by Key = "<< arg[3] << std::endl;
return 1;

Some files were not shown because too many files have changed in this diff Show More