mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-18 14:27:39 +03:00
Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f542f0c4ff | ||
|
86e352849d | ||
|
6d140acb14 | ||
|
44be123039 | ||
|
47263fa6a3 | ||
|
b0afa94d10 | ||
|
c772c6caa4 | ||
|
53eae1a935 | ||
|
d22b135217 | ||
|
3c7c705d77 | ||
|
fc72568ba9 | ||
|
107b57a955 | ||
|
8b301eb865 | ||
|
1f469e3781 | ||
|
ce4d294074 | ||
|
9f338a00a1 | ||
|
a011359b8a | ||
|
42e4ae96ae | ||
|
686926c0a9 | ||
|
a638dd6224 | ||
|
961a306dc4 | ||
|
195a068c4f | ||
|
669e0dfc17 | ||
|
74cb5673a5 |
51
src/AIS/AIS_AnimationAxisRotation.cxx
Normal file
51
src/AIS/AIS_AnimationAxisRotation.cxx
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
// Copyright (c) 2023 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 <AIS_AnimationAxisRotation.hxx>
|
||||||
|
|
||||||
|
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationAxisRotation, AIS_BaseAnimationObject)
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//function : Constructor
|
||||||
|
//purpose :
|
||||||
|
//=============================================================================
|
||||||
|
AIS_AnimationAxisRotation::AIS_AnimationAxisRotation (const TCollection_AsciiString& theAnimationName,
|
||||||
|
const Handle(AIS_InteractiveContext)& theContext,
|
||||||
|
const Handle(AIS_InteractiveObject)& theObject,
|
||||||
|
const gp_Ax1& theAxis,
|
||||||
|
const Standard_Real theAngleStart,
|
||||||
|
const Standard_Real theAngleEnd)
|
||||||
|
: AIS_BaseAnimationObject (theAnimationName, theContext, theObject),
|
||||||
|
myRotAxis (theAxis),
|
||||||
|
myAngleStart (theAngleStart),
|
||||||
|
myAngleEnd (theAngleEnd)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//function : update
|
||||||
|
//purpose :
|
||||||
|
//=============================================================================
|
||||||
|
void AIS_AnimationAxisRotation::update (const AIS_AnimationProgress& theProgress)
|
||||||
|
{
|
||||||
|
if (myObject.IsNull())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gp_Trsf aTrsf;
|
||||||
|
Standard_Real aCurrentAngle = (1.0 - theProgress.LocalNormalized) * myAngleStart + theProgress.LocalNormalized * myAngleEnd;
|
||||||
|
aTrsf.SetRotation (myRotAxis, aCurrentAngle);
|
||||||
|
updateTrsf (aTrsf);
|
||||||
|
}
|
53
src/AIS/AIS_AnimationAxisRotation.hxx
Normal file
53
src/AIS/AIS_AnimationAxisRotation.hxx
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
// Copyright (c) 2023 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 _AIS_AnimationAxisRotation_HeaderFile
|
||||||
|
#define _AIS_AnimationAxisRotation_HeaderFile
|
||||||
|
|
||||||
|
#include <AIS_BaseAnimationObject.hxx>
|
||||||
|
#include <gp_TrsfNLerp.hxx>
|
||||||
|
|
||||||
|
//! Animation defining object transformation.
|
||||||
|
class AIS_AnimationAxisRotation : public AIS_BaseAnimationObject
|
||||||
|
{
|
||||||
|
DEFINE_STANDARD_RTTIEXT(AIS_AnimationAxisRotation, AIS_BaseAnimationObject)
|
||||||
|
public:
|
||||||
|
|
||||||
|
//! Constructor with initialization.
|
||||||
|
//! @param[in] theAnimationName animation identifier
|
||||||
|
//! @param[in] theContext interactive context where object have been displayed
|
||||||
|
//! @param[in] theObject object to apply rotation
|
||||||
|
//! @param[in] theAxis rotation axis
|
||||||
|
//! @param[in] theAngleStart rotation angle at the start of animation
|
||||||
|
//! @param[in] theAngleEnd rotation angle at the end of animation
|
||||||
|
Standard_EXPORT AIS_AnimationAxisRotation (const TCollection_AsciiString& theAnimationName,
|
||||||
|
const Handle(AIS_InteractiveContext)& theContext,
|
||||||
|
const Handle(AIS_InteractiveObject)& theObject,
|
||||||
|
const gp_Ax1& theAxis,
|
||||||
|
const Standard_Real theAngleStart,
|
||||||
|
const Standard_Real theAngleEnd);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
//! Update the progress.
|
||||||
|
Standard_EXPORT virtual void update (const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
gp_Ax1 myRotAxis; //!< rotation axis
|
||||||
|
Standard_Real myAngleStart; //!< start angle for rotation
|
||||||
|
Standard_Real myAngleEnd; //!< end angle for rotation
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _AIS_AnimationAxisRotation_HeaderFile
|
@@ -14,10 +14,7 @@
|
|||||||
|
|
||||||
#include <AIS_AnimationObject.hxx>
|
#include <AIS_AnimationObject.hxx>
|
||||||
|
|
||||||
#include <AIS_InteractiveContext.hxx>
|
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_BaseAnimationObject)
|
||||||
#include <V3d_View.hxx>
|
|
||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_Animation)
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//function : Constructor
|
//function : Constructor
|
||||||
@@ -28,9 +25,7 @@ AIS_AnimationObject::AIS_AnimationObject (const TCollection_AsciiString& theAnim
|
|||||||
const Handle(AIS_InteractiveObject)& theObject,
|
const Handle(AIS_InteractiveObject)& theObject,
|
||||||
const gp_Trsf& theTrsfStart,
|
const gp_Trsf& theTrsfStart,
|
||||||
const gp_Trsf& theTrsfEnd)
|
const gp_Trsf& theTrsfEnd)
|
||||||
: AIS_Animation (theAnimationName),
|
: AIS_BaseAnimationObject (theAnimationName, theContext, theObject),
|
||||||
myContext (theContext),
|
|
||||||
myObject (theObject),
|
|
||||||
myTrsfLerp (theTrsfStart, theTrsfEnd)
|
myTrsfLerp (theTrsfStart, theTrsfEnd)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -49,52 +44,5 @@ void AIS_AnimationObject::update (const AIS_AnimationProgress& theProgress)
|
|||||||
|
|
||||||
gp_Trsf aTrsf;
|
gp_Trsf aTrsf;
|
||||||
myTrsfLerp.Interpolate (theProgress.LocalNormalized, aTrsf);
|
myTrsfLerp.Interpolate (theProgress.LocalNormalized, aTrsf);
|
||||||
if (!myContext.IsNull())
|
updateTrsf (aTrsf);
|
||||||
{
|
|
||||||
myContext->SetLocation (myObject, aTrsf);
|
|
||||||
invalidateViewer();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
myObject->SetLocalTransformation (aTrsf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=============================================================================
|
|
||||||
//function : invalidateViewer
|
|
||||||
//purpose :
|
|
||||||
//=============================================================================
|
|
||||||
void AIS_AnimationObject::invalidateViewer()
|
|
||||||
{
|
|
||||||
if (myContext.IsNull())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Standard_Boolean isImmediate = myContext->CurrentViewer()->ZLayerSettings (myObject->ZLayer()).IsImmediate();
|
|
||||||
if (!isImmediate)
|
|
||||||
{
|
|
||||||
myContext->CurrentViewer()->Invalidate();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Invalidate immediate view only if it is going out of z-fit range.
|
|
||||||
// This might be sub-optimal performing this for each animated objects in case of many animated objects.
|
|
||||||
for (V3d_ListOfView::Iterator aDefViewIter = myContext->CurrentViewer()->DefinedViewIterator();
|
|
||||||
aDefViewIter.More(); aDefViewIter.Next())
|
|
||||||
{
|
|
||||||
const Handle(V3d_View)& aView = aDefViewIter.Value();
|
|
||||||
const Bnd_Box aMinMaxBox = aView->View()->MinMaxValues (Standard_False);
|
|
||||||
const Bnd_Box aGraphicBox = aView->View()->MinMaxValues (Standard_True);
|
|
||||||
Standard_Real aZNear = 0.0;
|
|
||||||
Standard_Real aZFar = 0.0;
|
|
||||||
if (aView->Camera()->ZFitAll (aDefViewIter.Value()->AutoZFitScaleFactor(), aMinMaxBox, aGraphicBox, aZNear, aZFar))
|
|
||||||
{
|
|
||||||
if (aZNear < aView->Camera()->ZNear()
|
|
||||||
|| aZFar > aView->Camera()->ZFar())
|
|
||||||
{
|
|
||||||
aDefViewIter.Value()->Invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -15,24 +15,23 @@
|
|||||||
#ifndef _AIS_AnimationObject_HeaderFile
|
#ifndef _AIS_AnimationObject_HeaderFile
|
||||||
#define _AIS_AnimationObject_HeaderFile
|
#define _AIS_AnimationObject_HeaderFile
|
||||||
|
|
||||||
#include <AIS_Animation.hxx>
|
#include <AIS_BaseAnimationObject.hxx>
|
||||||
#include <AIS_InteractiveContext.hxx>
|
|
||||||
#include <gp_TrsfNLerp.hxx>
|
#include <gp_TrsfNLerp.hxx>
|
||||||
|
|
||||||
//! Animation defining object transformation.
|
//! Animation defining object transformation.
|
||||||
class AIS_AnimationObject : public AIS_Animation
|
class AIS_AnimationObject : public AIS_BaseAnimationObject
|
||||||
{
|
{
|
||||||
DEFINE_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_Animation)
|
DEFINE_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_BaseAnimationObject)
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Constructor with initialization.
|
//! Constructor with initialization.
|
||||||
//! Note that start/end transformations specify exactly local transformation of the object,
|
//! Note that start/end transformations specify exactly local transformation of the object,
|
||||||
//! not the transformation to be applied to existing local transformation.
|
//! not the transformation to be applied to existing local transformation.
|
||||||
//! @param theAnimationName animation identifier
|
//! @param[in] theAnimationName animation identifier
|
||||||
//! @param theContext interactive context where object have been displayed
|
//! @param[in] theContext interactive context where object have been displayed
|
||||||
//! @param theObject object to apply local transformation
|
//! @param[in] theObject object to apply local transformation
|
||||||
//! @param theTrsfStart local transformation at the start of animation (e.g. theObject->LocalTransformation())
|
//! @param[in] theTrsfStart local transformation at the start of animation (e.g. theObject->LocalTransformation())
|
||||||
//! @param theTrsfEnd local transformation at the end of animation
|
//! @param[in] theTrsfEnd local transformation at the end of animation
|
||||||
Standard_EXPORT AIS_AnimationObject (const TCollection_AsciiString& theAnimationName,
|
Standard_EXPORT AIS_AnimationObject (const TCollection_AsciiString& theAnimationName,
|
||||||
const Handle(AIS_InteractiveContext)& theContext,
|
const Handle(AIS_InteractiveContext)& theContext,
|
||||||
const Handle(AIS_InteractiveObject)& theObject,
|
const Handle(AIS_InteractiveObject)& theObject,
|
||||||
@@ -44,17 +43,10 @@ protected:
|
|||||||
//! Update the progress.
|
//! Update the progress.
|
||||||
Standard_EXPORT virtual void update (const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
|
Standard_EXPORT virtual void update (const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
|
||||||
|
|
||||||
//! Invalidate the viewer for proper update.
|
private:
|
||||||
Standard_EXPORT void invalidateViewer();
|
|
||||||
|
|
||||||
protected:
|
gp_TrsfNLerp myTrsfLerp; //!< interpolation tool
|
||||||
|
|
||||||
Handle(AIS_InteractiveContext) myContext; //!< context where object is displayed
|
|
||||||
Handle(AIS_InteractiveObject) myObject; //!< presentation object to set location
|
|
||||||
gp_TrsfNLerp myTrsfLerp; //!< interpolation tool
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DEFINE_STANDARD_HANDLE(AIS_AnimationObject, AIS_Animation)
|
|
||||||
|
|
||||||
#endif // _AIS_AnimationObject_HeaderFile
|
#endif // _AIS_AnimationObject_HeaderFile
|
||||||
|
88
src/AIS/AIS_BaseAnimationObject.cxx
Normal file
88
src/AIS/AIS_BaseAnimationObject.cxx
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
// Copyright (c) 2023 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 <AIS_BaseAnimationObject.hxx>
|
||||||
|
|
||||||
|
#include <V3d_View.hxx>
|
||||||
|
|
||||||
|
IMPLEMENT_STANDARD_RTTIEXT(AIS_BaseAnimationObject, AIS_Animation)
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//function : Constructor
|
||||||
|
//purpose :
|
||||||
|
//=============================================================================
|
||||||
|
AIS_BaseAnimationObject::AIS_BaseAnimationObject (const TCollection_AsciiString& theAnimationName,
|
||||||
|
const Handle(AIS_InteractiveContext)& theContext,
|
||||||
|
const Handle(AIS_InteractiveObject)& theObject)
|
||||||
|
: AIS_Animation (theAnimationName),
|
||||||
|
myContext (theContext),
|
||||||
|
myObject (theObject)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//function : updateTrsf
|
||||||
|
//purpose :
|
||||||
|
//=============================================================================
|
||||||
|
void AIS_BaseAnimationObject::updateTrsf (const gp_Trsf& theTrsf)
|
||||||
|
{
|
||||||
|
if (!myContext.IsNull())
|
||||||
|
{
|
||||||
|
myContext->SetLocation (myObject, theTrsf);
|
||||||
|
invalidateViewer();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
myObject->SetLocalTransformation (theTrsf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//function : invalidateViewer
|
||||||
|
//purpose :
|
||||||
|
//=============================================================================
|
||||||
|
void AIS_BaseAnimationObject::invalidateViewer()
|
||||||
|
{
|
||||||
|
if (myContext.IsNull())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Standard_Boolean isImmediate = myContext->CurrentViewer()->ZLayerSettings (myObject->ZLayer()).IsImmediate();
|
||||||
|
if (!isImmediate)
|
||||||
|
{
|
||||||
|
myContext->CurrentViewer()->Invalidate();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Invalidate immediate view only if it is going out of z-fit range.
|
||||||
|
// This might be sub-optimal performing this for each animated objects in case of many animated objects.
|
||||||
|
for (V3d_ListOfView::Iterator aDefViewIter = myContext->CurrentViewer()->DefinedViewIterator();
|
||||||
|
aDefViewIter.More(); aDefViewIter.Next())
|
||||||
|
{
|
||||||
|
const Handle(V3d_View)& aView = aDefViewIter.Value();
|
||||||
|
const Bnd_Box aMinMaxBox = aView->View()->MinMaxValues (Standard_False);
|
||||||
|
const Bnd_Box aGraphicBox = aView->View()->MinMaxValues (Standard_True);
|
||||||
|
Standard_Real aZNear = 0.0;
|
||||||
|
Standard_Real aZFar = 0.0;
|
||||||
|
if (aView->Camera()->ZFitAll (aDefViewIter.Value()->AutoZFitScaleFactor(), aMinMaxBox, aGraphicBox, aZNear, aZFar))
|
||||||
|
{
|
||||||
|
if (aZNear < aView->Camera()->ZNear()
|
||||||
|
|| aZFar > aView->Camera()->ZFar())
|
||||||
|
{
|
||||||
|
aDefViewIter.Value()->Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
49
src/AIS/AIS_BaseAnimationObject.hxx
Normal file
49
src/AIS/AIS_BaseAnimationObject.hxx
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
// Copyright (c) 2023 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 _AIS_BaseAnimationObject_HeaderFile
|
||||||
|
#define _AIS_BaseAnimationObject_HeaderFile
|
||||||
|
|
||||||
|
#include <AIS_Animation.hxx>
|
||||||
|
#include <AIS_InteractiveContext.hxx>
|
||||||
|
|
||||||
|
//! Animation defining object transformation.
|
||||||
|
class AIS_BaseAnimationObject : public AIS_Animation
|
||||||
|
{
|
||||||
|
DEFINE_STANDARD_RTTIEXT(AIS_BaseAnimationObject, AIS_Animation)
|
||||||
|
protected:
|
||||||
|
|
||||||
|
//! Constructor with initialization.
|
||||||
|
//! @param[in] theAnimationName animation identifier
|
||||||
|
//! @param[in] theContext interactive context where object have been displayed
|
||||||
|
//! @param[in] theObject object to apply local transformation
|
||||||
|
Standard_EXPORT AIS_BaseAnimationObject (const TCollection_AsciiString& theAnimationName,
|
||||||
|
const Handle(AIS_InteractiveContext)& theContext,
|
||||||
|
const Handle(AIS_InteractiveObject)& theObject);
|
||||||
|
|
||||||
|
//! Update the transformation.
|
||||||
|
Standard_EXPORT void updateTrsf (const gp_Trsf& theTrsf);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
//! Invalidate the viewer for proper update.
|
||||||
|
Standard_EXPORT void invalidateViewer();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
Handle(AIS_InteractiveContext) myContext; //!< context where object is displayed
|
||||||
|
Handle(AIS_InteractiveObject) myObject; //!< presentation object to set location
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _AIS_BaseAnimationObject_HeaderFile
|
@@ -1116,18 +1116,23 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
|
|||||||
const Standard_Integer theMode)
|
const Standard_Integer theMode)
|
||||||
{
|
{
|
||||||
//Check mode
|
//Check mode
|
||||||
AIS_ManipulatorMode aMode = (AIS_ManipulatorMode) theMode;
|
const AIS_ManipulatorMode aMode = (AIS_ManipulatorMode) theMode;
|
||||||
if (aMode == AIS_MM_None)
|
if (aMode == AIS_MM_None)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Handle(SelectMgr_EntityOwner) anOwner;
|
Handle(SelectMgr_EntityOwner) anOwner;
|
||||||
if (aMode == AIS_MM_None)
|
|
||||||
{
|
|
||||||
anOwner = new SelectMgr_EntityOwner (this, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aMode == AIS_MM_Translation || aMode == AIS_MM_None)
|
// Sensitivity calculation for manipulator parts allows to avoid
|
||||||
|
// overlapping of sensitive areas when size of manipulator is small.
|
||||||
|
// Sensitivity is calculated relative to the default size of the manipulator (100.0f).
|
||||||
|
const Standard_ShortReal aSensitivityCoef = myAxes[0].Size() / 100.0f;
|
||||||
|
const Standard_Integer aHighSensitivity = Max (Min (RealToInt (aSensitivityCoef * 15), 15), 3); // clamp sensitivity within range [3, 15]
|
||||||
|
const Standard_Integer aLowSensitivity = Max (Min (RealToInt (aSensitivityCoef * 10), 10), 2); // clamp sensitivity within range [2, 10]
|
||||||
|
|
||||||
|
switch (aMode)
|
||||||
|
{
|
||||||
|
case AIS_MM_Translation:
|
||||||
{
|
{
|
||||||
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||||
{
|
{
|
||||||
@@ -1136,23 +1141,21 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const Axis& anAxis = myAxes[anIt];
|
const Axis& anAxis = myAxes[anIt];
|
||||||
if (aMode != AIS_MM_None)
|
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Translation, 9);
|
||||||
{
|
|
||||||
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Translation, 9);
|
|
||||||
}
|
|
||||||
// define sensitivity by line
|
// define sensitivity by line
|
||||||
Handle(Select3D_SensitiveSegment) aLine = new Select3D_SensitiveSegment (anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
|
Handle(Select3D_SensitiveSegment) aLine = new Select3D_SensitiveSegment(anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
|
||||||
aLine->SetSensitivityFactor (15);
|
aLine->SetSensitivityFactor (aHighSensitivity);
|
||||||
theSelection->Add (aLine);
|
theSelection->Add (aLine);
|
||||||
|
|
||||||
// enlarge sensitivity by triangulation
|
// enlarge sensitivity by triangulation
|
||||||
Handle(Select3D_SensitivePrimitiveArray) aTri = new Select3D_SensitivePrimitiveArray (anOwner);
|
Handle(Select3D_SensitivePrimitiveArray) aTri = new Select3D_SensitivePrimitiveArray(anOwner);
|
||||||
aTri->InitTriangulation (anAxis.TriangleArray()->Attributes(), anAxis.TriangleArray()->Indices(), TopLoc_Location());
|
aTri->InitTriangulation (anAxis.TriangleArray()->Attributes(), anAxis.TriangleArray()->Indices(), TopLoc_Location());
|
||||||
theSelection->Add (aTri);
|
theSelection->Add (aTri);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
case AIS_MM_Rotation:
|
||||||
if (aMode == AIS_MM_Rotation || aMode == AIS_MM_None)
|
|
||||||
{
|
{
|
||||||
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||||
{
|
{
|
||||||
@@ -1161,22 +1164,20 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const Axis& anAxis = myAxes[anIt];
|
const Axis& anAxis = myAxes[anIt];
|
||||||
if (aMode != AIS_MM_None)
|
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Rotation, 9);
|
||||||
{
|
|
||||||
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Rotation, 9);
|
|
||||||
}
|
|
||||||
// define sensitivity by circle
|
// define sensitivity by circle
|
||||||
const gp_Circ aGeomCircle (gp_Ax2 (gp::Origin(), anAxis.ReferenceAxis().Direction()), anAxis.RotatorDiskRadius());
|
const gp_Circ aGeomCircle (gp_Ax2(gp::Origin(), anAxis.ReferenceAxis().Direction()), anAxis.RotatorDiskRadius());
|
||||||
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle (anOwner, aGeomCircle);
|
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle(anOwner, aGeomCircle);
|
||||||
aCircle->SetSensitivityFactor (15);
|
aCircle->SetSensitivityFactor (aLowSensitivity);
|
||||||
theSelection->Add (aCircle);
|
theSelection->Add(aCircle);
|
||||||
// enlarge sensitivity by triangulation
|
// enlarge sensitivity by triangulation
|
||||||
Handle(Select3D_SensitiveTriangulation) aTri = new ManipSensTriangulation (anOwner, myAxes[anIt].RotatorDisk().Triangulation(), anAxis.ReferenceAxis().Direction());
|
Handle(Select3D_SensitiveTriangulation) aTri = new ManipSensTriangulation(anOwner, myAxes[anIt].RotatorDisk().Triangulation(), anAxis.ReferenceAxis().Direction());
|
||||||
theSelection->Add (aTri);
|
theSelection->Add (aTri);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
case AIS_MM_Scaling:
|
||||||
if (aMode == AIS_MM_Scaling || aMode == AIS_MM_None)
|
|
||||||
{
|
{
|
||||||
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||||
{
|
{
|
||||||
@@ -1184,21 +1185,19 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (aMode != AIS_MM_None)
|
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Scaling, 9);
|
||||||
{
|
|
||||||
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Scaling, 9);
|
|
||||||
}
|
|
||||||
// define sensitivity by point
|
// define sensitivity by point
|
||||||
Handle(Select3D_SensitivePoint) aPnt = new Select3D_SensitivePoint (anOwner, myAxes[anIt].ScalerCubePosition());
|
Handle(Select3D_SensitivePoint) aPnt = new Select3D_SensitivePoint(anOwner, myAxes[anIt].ScalerCubePosition());
|
||||||
aPnt->SetSensitivityFactor (15);
|
aPnt->SetSensitivityFactor (aHighSensitivity);
|
||||||
theSelection->Add (aPnt);
|
theSelection->Add (aPnt);
|
||||||
// enlarge sensitivity by triangulation
|
// enlarge sensitivity by triangulation
|
||||||
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation (anOwner, myAxes[anIt].ScalerCube().Triangulation(), TopLoc_Location(), Standard_True);
|
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].ScalerCube().Triangulation(), TopLoc_Location(), Standard_True);
|
||||||
theSelection->Add (aTri);
|
theSelection->Add (aTri);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
case AIS_MM_TranslationPlane:
|
||||||
if (aMode == AIS_MM_TranslationPlane || aMode == AIS_MM_None)
|
|
||||||
{
|
{
|
||||||
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||||
{
|
{
|
||||||
@@ -1206,28 +1205,33 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (aMode != AIS_MM_None)
|
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_TranslationPlane, 9);
|
||||||
{
|
|
||||||
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_TranslationPlane, 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
// define sensitivity by two crossed lines
|
// define sensitivity by two crossed lines
|
||||||
gp_Pnt aP1, aP2;
|
Standard_Real aSensitivityOffset = ZoomPersistence() ? aHighSensitivity * (0.5 + M_SQRT2) : 0.0;
|
||||||
aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition();
|
gp_Pnt aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition().Translated (myAxes[((anIt + 2) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
|
||||||
aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition();
|
gp_Pnt aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition().Translated (myAxes[((anIt + 1) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
|
||||||
gp_XYZ aMidP = (aP1.XYZ() + aP2.XYZ()) / 2.0;
|
gp_XYZ aMidP = (aP1.XYZ() + aP2.XYZ()) / 2.0;
|
||||||
|
gp_XYZ anOrig = aMidP.Normalized().Multiplied (aSensitivityOffset);
|
||||||
|
|
||||||
Handle(Select3D_SensitiveSegment) aLine1 = new Select3D_SensitiveSegment(anOwner, aP1, aP2);
|
Handle(Select3D_SensitiveSegment) aLine1 = new Select3D_SensitiveSegment(anOwner, aP1, aP2);
|
||||||
aLine1->SetSensitivityFactor(10);
|
aLine1->SetSensitivityFactor(aLowSensitivity);
|
||||||
theSelection->Add(aLine1);
|
theSelection->Add (aLine1);
|
||||||
Handle(Select3D_SensitiveSegment) aLine2 = new Select3D_SensitiveSegment(anOwner, gp::Origin(), aMidP);
|
Handle(Select3D_SensitiveSegment) aLine2 = new Select3D_SensitiveSegment(anOwner, anOrig, aMidP);
|
||||||
aLine2->SetSensitivityFactor(10);
|
aLine2->SetSensitivityFactor (aLowSensitivity);
|
||||||
theSelection->Add(aLine2);
|
theSelection->Add (aLine2);
|
||||||
|
|
||||||
// enlarge sensitivity by triangulation
|
// enlarge sensitivity by triangulation
|
||||||
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].DraggerSector().Triangulation(), TopLoc_Location(), Standard_True);
|
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].DraggerSector().Triangulation(), TopLoc_Location(), Standard_True);
|
||||||
theSelection->Add(aTri);
|
theSelection->Add (aTri);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
anOwner = new SelectMgr_EntityOwner(this, 5);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,6 +2,8 @@ AIS.hxx
|
|||||||
AIS_Animation.cxx
|
AIS_Animation.cxx
|
||||||
AIS_Animation.hxx
|
AIS_Animation.hxx
|
||||||
AIS_AnimationTimer.hxx
|
AIS_AnimationTimer.hxx
|
||||||
|
AIS_AnimationAxisRotation.cxx
|
||||||
|
AIS_AnimationAxisRotation.hxx
|
||||||
AIS_AnimationCamera.cxx
|
AIS_AnimationCamera.cxx
|
||||||
AIS_AnimationCamera.hxx
|
AIS_AnimationCamera.hxx
|
||||||
AIS_AnimationObject.cxx
|
AIS_AnimationObject.cxx
|
||||||
@@ -12,6 +14,8 @@ AIS_Axis.cxx
|
|||||||
AIS_Axis.hxx
|
AIS_Axis.hxx
|
||||||
AIS_BadEdgeFilter.cxx
|
AIS_BadEdgeFilter.cxx
|
||||||
AIS_BadEdgeFilter.hxx
|
AIS_BadEdgeFilter.hxx
|
||||||
|
AIS_BaseAnimationObject.cxx
|
||||||
|
AIS_BaseAnimationObject.hxx
|
||||||
AIS_C0RegularityFilter.cxx
|
AIS_C0RegularityFilter.cxx
|
||||||
AIS_C0RegularityFilter.hxx
|
AIS_C0RegularityFilter.hxx
|
||||||
AIS_CameraFrustum.cxx
|
AIS_CameraFrustum.cxx
|
||||||
|
@@ -248,167 +248,178 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
|
|||||||
//
|
//
|
||||||
// Build the shells
|
// Build the shells
|
||||||
aItF.Initialize (aLFConnected);
|
aItF.Initialize (aLFConnected);
|
||||||
for (i = 1; aItF.More() && !bAllFacesTaken; aItF.Next(), ++i) {
|
for (i = 1; aItF.More() && !bAllFacesTaken; aItF.Next(), ++i)
|
||||||
|
{
|
||||||
const TopoDS_Shape& aFF = aItF.Value();
|
const TopoDS_Shape& aFF = aItF.Value();
|
||||||
if (!AddedFacesMap.Add(aFF)) {
|
if (!AddedFacesMap.Add(aFF)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// make a new shell
|
// make a new shell
|
||||||
TopoDS_Shell aShellStart;
|
TopoDS_Shell aShell;
|
||||||
aBB.MakeShell(aShellStart);
|
aBB.MakeShell(aShell);
|
||||||
aBB.Add(aShellStart, aFF);
|
aBB.Add(aShell, aFF);
|
||||||
|
|
||||||
|
aMEFP.Clear();
|
||||||
|
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
||||||
//
|
//
|
||||||
TopTools_ListOfShape aLShells;
|
// loop on faces added to Shell;
|
||||||
aLShells.Append(aShellStart);
|
// add their neighbor faces to Shell and so on
|
||||||
//
|
aItS.Initialize(aShell);
|
||||||
TopTools_ListIteratorOfListOfShape aItLShells(aLShells);
|
for (; aItS.More(); aItS.Next()) {
|
||||||
for (; aItLShells.More(); aItLShells.Next()) {
|
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value()));
|
||||||
TopoDS_Shell& aShell = TopoDS::Shell(aItLShells.ChangeValue());
|
Standard_Boolean isBoundary = aBoundaryFaces.Contains (aF);
|
||||||
//
|
//
|
||||||
aMEFP.Clear();
|
// loop on edges of aF; find a good neighbor face of aF by aE
|
||||||
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
aExp.Init(aF, TopAbs_EDGE);
|
||||||
//
|
for (; aExp.More(); aExp.Next()) {
|
||||||
// loop on faces added to Shell;
|
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
|
||||||
// add their neighbor faces to Shell and so on
|
|
||||||
aItS.Initialize(aShell);
|
|
||||||
for (; aItS.More(); aItS.Next()) {
|
|
||||||
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value()));
|
|
||||||
Standard_Boolean isBoundary = aBoundaryFaces.Contains (aF);
|
|
||||||
//
|
//
|
||||||
// loop on edges of aF; find a good neighbor face of aF by aE
|
// proceed only free edges in this shell
|
||||||
aExp.Init(aF, TopAbs_EDGE);
|
if (aMEFP.Contains(aE)) {
|
||||||
for (; aExp.More(); aExp.Next()) {
|
const TopTools_ListOfShape& aLFP = aMEFP.FindFromKey(aE);
|
||||||
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
|
aNbFP = aLFP.Extent();
|
||||||
//
|
if (aNbFP > 1) {
|
||||||
// proceed only free edges in this shell
|
|
||||||
if (aMEFP.Contains(aE)) {
|
|
||||||
const TopTools_ListOfShape& aLFP = aMEFP.FindFromKey(aE);
|
|
||||||
aNbFP = aLFP.Extent();
|
|
||||||
if (aNbFP > 1) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// avoid processing of internal edges
|
|
||||||
anOr = aE.Orientation();
|
|
||||||
if (anOr == TopAbs_INTERNAL) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// avoid processing of degenerated edges
|
}
|
||||||
if (BRep_Tool::Degenerated(aE)) {
|
// avoid processing of internal edges
|
||||||
|
anOr = aE.Orientation();
|
||||||
|
if (anOr == TopAbs_INTERNAL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// avoid processing of degenerated edges
|
||||||
|
if (BRep_Tool::Degenerated(aE)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// candidate faces list
|
||||||
|
const TopTools_ListOfShape& aLF = aEFMap.FindFromKey(aE);
|
||||||
|
aNbLF = aLF.Extent();
|
||||||
|
if (!aNbLF) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// prepare for selecting the next face
|
||||||
|
// take only not-processed faces as a candidates
|
||||||
|
BOPTools_ListOfCoupleOfShape aLCSOff;
|
||||||
|
//
|
||||||
|
Standard_Integer aNbWaysInside = 0;
|
||||||
|
TopoDS_Face aSelF;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItLF(aLF);
|
||||||
|
for (; aItLF.More(); aItLF.Next()) {
|
||||||
|
const TopoDS_Face& aFL = (*(TopoDS_Face*)(&aItLF.Value()));
|
||||||
|
if (aF.IsSame(aFL) || AddedFacesMap.Contains(aFL)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// candidate faces list
|
// find current edge in the face
|
||||||
const TopTools_ListOfShape& aLF = aEFMap.FindFromKey(aE);
|
if (!BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL)) {
|
||||||
aNbLF = aLF.Extent();
|
|
||||||
if (!aNbLF) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// prepare for selecting the next face
|
if (isBoundary && !aBoundaryFaces.Contains (aFL))
|
||||||
// take only not-processed faces as a candidates
|
|
||||||
BOPTools_ListOfCoupleOfShape aLCSOff;
|
|
||||||
//
|
|
||||||
Standard_Integer aNbWaysInside = 0;
|
|
||||||
TopoDS_Face aSelF;
|
|
||||||
TopTools_ListIteratorOfListOfShape aItLF(aLF);
|
|
||||||
for (; aItLF.More(); aItLF.Next()) {
|
|
||||||
const TopoDS_Face& aFL = (*(TopoDS_Face*)(&aItLF.Value()));
|
|
||||||
if (aF.IsSame(aFL) || AddedFacesMap.Contains(aFL)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// find current edge in the face
|
|
||||||
if (!BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
if (isBoundary && !aBoundaryFaces.Contains (aFL))
|
|
||||||
{
|
|
||||||
++aNbWaysInside;
|
|
||||||
aSelF = aFL;
|
|
||||||
}
|
|
||||||
aCSOff.SetShape1(aEL);
|
|
||||||
aCSOff.SetShape2(aFL);
|
|
||||||
aLCSOff.Append(aCSOff);
|
|
||||||
}//for (; aItLF.More(); aItLF.Next()) {
|
|
||||||
//
|
|
||||||
aNbOff = aLCSOff.Extent();
|
|
||||||
if (!aNbOff){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// among all the adjacent faces chose one with the minimal
|
|
||||||
// angle to the current one
|
|
||||||
if (!isBoundary || aNbWaysInside != 1)
|
|
||||||
{
|
{
|
||||||
if (aNbOff == 1) {
|
++aNbWaysInside;
|
||||||
aSelF = (*(TopoDS_Face*)(&aLCSOff.First().Shape2()));
|
aSelF = aFL;
|
||||||
}
|
|
||||||
else if (aNbOff > 1) {
|
|
||||||
BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF, aContext);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//
|
aCSOff.SetShape1(aEL);
|
||||||
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
|
aCSOff.SetShape2(aFL);
|
||||||
aBB.Add(aShell, aSelF);
|
aLCSOff.Append(aCSOff);
|
||||||
TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
}//for (; aItLF.More(); aItLF.Next()) {
|
||||||
}
|
|
||||||
} // for (; aExp.More(); aExp.Next()) {
|
|
||||||
} // for (; aItS.More(); aItS.Next()) {
|
|
||||||
//
|
|
||||||
// split the shell on multi-connected edges
|
|
||||||
TopTools_ListOfShape aLShSp;
|
|
||||||
RefineShell(aShell, aMEFP, aLShSp);
|
|
||||||
//
|
|
||||||
// collect the not closed shells for further processing
|
|
||||||
TopTools_ListOfShape aLShNC;
|
|
||||||
//
|
|
||||||
TopTools_ListIteratorOfListOfShape aItLShSp(aLShSp);
|
|
||||||
for (; aItLShSp.More(); aItLShSp.Next()) {
|
|
||||||
TopoDS_Shell& aShSp = *((TopoDS_Shell*)&aItLShSp.Value());
|
|
||||||
//
|
//
|
||||||
if (BRep_Tool::IsClosed(aShSp)) {
|
aNbOff = aLCSOff.Extent();
|
||||||
aShSp.Closed(Standard_True);
|
if (!aNbOff){
|
||||||
myLoops.Append(aShSp);
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
//
|
||||||
aLShNC.Append(aShSp);
|
// among all the adjacent faces chose one with the minimal
|
||||||
}
|
// angle to the current one
|
||||||
}
|
if (!isBoundary || aNbWaysInside != 1)
|
||||||
//
|
{
|
||||||
bAllFacesTaken = (AddedFacesMap.Extent() == aNbShapes);
|
if (aNbOff == 1) {
|
||||||
if (bAllFacesTaken) {
|
aSelF = (*(TopoDS_Face*)(&aLCSOff.First().Shape2()));
|
||||||
break;
|
}
|
||||||
}
|
else if (aNbOff > 1) {
|
||||||
//
|
BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF, aContext);
|
||||||
if (aLShSp.Extent() == 1) {
|
|
||||||
// not further processing of not closed shells is needed,
|
|
||||||
// as it will not bring any new results
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
Standard_Integer aNbShNC = aLShNC.Extent();
|
|
||||||
if (aNbShNC == 1) {
|
|
||||||
// try to complete the shell with other faces
|
|
||||||
aLShells.Append(aLShNC);
|
|
||||||
}
|
|
||||||
else if (aNbShNC > 1) {
|
|
||||||
// remove th faces of not closed shells from the map of processed faces
|
|
||||||
// and try to rebuild the shells using all not processed faces,
|
|
||||||
// because faces of one shell might be needed for building the other
|
|
||||||
TopTools_ListIteratorOfListOfShape aItLShNC(aLShNC);
|
|
||||||
for (; aItLShNC.More(); aItLShNC.Next()) {
|
|
||||||
TopoDS_Iterator aItNC(aItLShNC.Value());
|
|
||||||
for (; aItNC.More(); aItNC.Next()) {
|
|
||||||
AddedFacesMap.Remove(aItNC.Value());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
|
||||||
|
aBB.Add(aShell, aSelF);
|
||||||
|
TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
||||||
|
}
|
||||||
|
} // for (; aExp.More(); aExp.Next()) {
|
||||||
|
} // for (; aItS.More(); aItS.Next()) {
|
||||||
|
//
|
||||||
|
// split the shell on multi-connected edges
|
||||||
|
TopTools_ListOfShape aLShSp;
|
||||||
|
RefineShell(aShell, aMEFP, aLShSp);
|
||||||
|
//
|
||||||
|
// collect the not closed shells for further processing
|
||||||
|
TopTools_ListOfShape aLShNC;
|
||||||
|
//
|
||||||
|
TopTools_ListIteratorOfListOfShape aItLShSp(aLShSp);
|
||||||
|
for (; aItLShSp.More(); aItLShSp.Next()) {
|
||||||
|
TopoDS_Shell& aShSp = *((TopoDS_Shell*)&aItLShSp.Value());
|
||||||
|
//
|
||||||
|
if (BRep_Tool::IsClosed(aShSp)) {
|
||||||
|
aShSp.Closed(Standard_True);
|
||||||
|
myLoops.Append(aShSp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aLShNC.Append(aShSp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bAllFacesTaken = (AddedFacesMap.Extent() == aNbShapes);
|
||||||
|
if (bAllFacesTaken) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (aLShSp.Extent() == 1) {
|
||||||
|
// not further processing of not closed shells is needed,
|
||||||
|
// as it will not bring any new results
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
|
||||||
|
// remove th faces of not closed shells from the map of processed faces
|
||||||
|
// and try to rebuild the shells using all not processed faces,
|
||||||
|
// because faces of one shell might be needed for building the other
|
||||||
|
TopTools_ListIteratorOfListOfShape aItLShNC(aLShNC);
|
||||||
|
for (; aItLShNC.More(); aItLShNC.Next())
|
||||||
|
{
|
||||||
|
TopoDS_Iterator aItNC(aItLShNC.Value());
|
||||||
|
for (; aItNC.More(); aItNC.Next())
|
||||||
|
{
|
||||||
|
AddedFacesMap.Remove(aItNC.Value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // for (; aItF.More(); aItF.Next()) {
|
} // for (; aItF.More(); aItF.Next()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : FindShape
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
TopoDS_Shape FindShape (const TopoDS_Shape& theShapeToFind,
|
||||||
|
const TopoDS_Shape& theShape)
|
||||||
|
{
|
||||||
|
TopoDS_Shape aRes;
|
||||||
|
TopExp_Explorer anExp(theShape, theShapeToFind.ShapeType());
|
||||||
|
for (; anExp.More(); anExp.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Shape& aShape = anExp.Current();
|
||||||
|
if (aShape.IsSame(theShapeToFind))
|
||||||
|
{
|
||||||
|
aRes = aShape;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return aRes;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : RefineShell
|
//function : RefineShell
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -434,6 +445,21 @@ void RefineShell(TopoDS_Shell& theShell,
|
|||||||
aMEStop.Add(aE);
|
aMEStop.Add(aE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (aLF.Extent() == 2)
|
||||||
|
{
|
||||||
|
const TopoDS_Face& aF1 = TopoDS::Face(aLF.First());
|
||||||
|
const TopoDS_Face& aF2 = TopoDS::Face(aLF.Last());
|
||||||
|
|
||||||
|
TopoDS_Shape aE1 = FindShape(aE, aF1);
|
||||||
|
TopoDS_Shape aE2 = FindShape(aE, aF2);
|
||||||
|
|
||||||
|
if (aE1.Orientation() == aE2.Orientation())
|
||||||
|
{
|
||||||
|
aMEStop.Add(aE);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// check for internal edges - count faces, in which the edge
|
// check for internal edges - count faces, in which the edge
|
||||||
// is internal, twice
|
// is internal, twice
|
||||||
|
@@ -60,7 +60,7 @@ public: //! @name public interfaces
|
|||||||
//! Clears the indices
|
//! Clears the indices
|
||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
myPairs.Clear();
|
myPairs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sorts the indices
|
//! Sorts the indices
|
||||||
|
@@ -127,6 +127,14 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
|
|||||||
for (ex.Init(S,TopAbs_EDGE,TopAbs_FACE); ex.More(); ex.Next())
|
for (ex.Init(S,TopAbs_EDGE,TopAbs_FACE); ex.More(); ex.Next())
|
||||||
{
|
{
|
||||||
const TopoDS_Edge& E = TopoDS::Edge(ex.Current());
|
const TopoDS_Edge& E = TopoDS::Edge(ex.Current());
|
||||||
|
|
||||||
|
if (!useTriangulation && BRep_Tool::IsGeometric(E))
|
||||||
|
{
|
||||||
|
BC.Initialize(E);
|
||||||
|
BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(E), B);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Handle(Poly_Polygon3D) P3d = BRep_Tool::Polygon3D(E, l);
|
Handle(Poly_Polygon3D) P3d = BRep_Tool::Polygon3D(E, l);
|
||||||
if (!P3d.IsNull() && P3d->NbNodes() > 0)
|
if (!P3d.IsNull() && P3d->NbNodes() > 0)
|
||||||
{
|
{
|
||||||
@@ -143,7 +151,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
BRep_Tool::PolygonOnTriangulation(E, Poly, T, l);
|
BRep_Tool::PolygonOnTriangulation(E, Poly, T, l);
|
||||||
if (useTriangulation && !Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
|
if (!Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
|
||||||
{
|
{
|
||||||
const TColStd_Array1OfInteger& Indices = Poly->Nodes();
|
const TColStd_Array1OfInteger& Indices = Poly->Nodes();
|
||||||
nbNodes = Indices.Length();
|
nbNodes = Indices.Length();
|
||||||
|
@@ -44,6 +44,8 @@
|
|||||||
#include <BRepGProp_Face.hxx>
|
#include <BRepGProp_Face.hxx>
|
||||||
#include <BRep_TEdge.hxx>
|
#include <BRep_TEdge.hxx>
|
||||||
#include <ShapeUpgrade_UnifySameDomain.hxx>
|
#include <ShapeUpgrade_UnifySameDomain.hxx>
|
||||||
|
#include <Bnd_Box.hxx>
|
||||||
|
#include <BRepBndLib.hxx>
|
||||||
|
|
||||||
#ifdef BRepFill_AdvancedEvolved_DEBUG
|
#ifdef BRepFill_AdvancedEvolved_DEBUG
|
||||||
#include <BinTools.hxx>
|
#include <BinTools.hxx>
|
||||||
@@ -524,9 +526,14 @@ void BRepFill_AdvancedEvolved::GetLids()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Standard_Real aTol = Max(aFS.Tolerance(), aFS.ToleranceReached());
|
||||||
|
aTol += myFuzzyValue;
|
||||||
|
Bnd_Box aProfBox;
|
||||||
|
BRepBndLib::Add(myProfile, aProfBox);
|
||||||
|
Standard_Real aSqDiag = aProfBox.SquareExtent();
|
||||||
//Square of the default angular tolerance in
|
//Square of the default angular tolerance in
|
||||||
//BOPAlgo_Tools::EdgesToWires(...) and BOPAlgo_Tools::WiresToFaces(...) methods
|
//BOPAlgo_Tools::EdgesToWires(...) and BOPAlgo_Tools::WiresToFaces(...) methods
|
||||||
const Standard_Real aSqAnguarTol = 1.0e-16;
|
const Standard_Real aSqAnguarTol = aTol*aTol / aSqDiag;
|
||||||
const gp_Dir &aNormal = aSurf->Position().Direction();
|
const gp_Dir &aNormal = aSurf->Position().Direction();
|
||||||
|
|
||||||
// Obtain free-edges from myPipeShell. All edges must be planar
|
// Obtain free-edges from myPipeShell. All edges must be planar
|
||||||
@@ -541,6 +548,7 @@ void BRepFill_AdvancedEvolved::GetLids()
|
|||||||
gp_Pnt aPtmp;
|
gp_Pnt aPtmp;
|
||||||
gp_Vec aTan;
|
gp_Vec aTan;
|
||||||
|
|
||||||
|
Standard_Real aDPMax = 0.;
|
||||||
for (Standard_Integer i = 1; i <= aMapEF.Size(); i++)
|
for (Standard_Integer i = 1; i <= aMapEF.Size(); i++)
|
||||||
{
|
{
|
||||||
TopTools_ListOfShape& aListF = aMapEF(i);
|
TopTools_ListOfShape& aListF = aMapEF(i);
|
||||||
@@ -564,6 +572,8 @@ void BRepFill_AdvancedEvolved::GetLids()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
const Standard_Real aDP = aTan.XYZ().Dot(aNormal.XYZ());
|
const Standard_Real aDP = aTan.XYZ().Dot(aNormal.XYZ());
|
||||||
|
if (Abs(aDP) > aDPMax)
|
||||||
|
aDPMax = Abs(aDP);
|
||||||
if (aDP*aDP>aSqModulus*aSqAnguarTol)
|
if (aDP*aDP>aSqModulus*aSqAnguarTol)
|
||||||
{
|
{
|
||||||
//Only planar edges are considered
|
//Only planar edges are considered
|
||||||
@@ -594,8 +604,9 @@ void BRepFill_AdvancedEvolved::GetLids()
|
|||||||
aBB.MakeCompound(aCompW);
|
aBB.MakeCompound(aCompW);
|
||||||
aBB.MakeCompound(aCompF);
|
aBB.MakeCompound(aCompF);
|
||||||
aBB.MakeCompound(myTopBottom);
|
aBB.MakeCompound(myTopBottom);
|
||||||
BOPAlgo_Tools::EdgesToWires(aFreeEdges, aCompW, Standard_True);
|
Standard_Real anAngTol = Sqrt(aSqAnguarTol);
|
||||||
BOPAlgo_Tools::WiresToFaces(aCompW, aCompF);
|
BOPAlgo_Tools::EdgesToWires(aFreeEdges, aCompW, Standard_True, anAngTol);
|
||||||
|
BOPAlgo_Tools::WiresToFaces(aCompW, aCompF, anAngTol);
|
||||||
|
|
||||||
{
|
{
|
||||||
// Check orientation
|
// Check orientation
|
||||||
|
@@ -351,6 +351,10 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
|
|||||||
for (j=1; j<=ndec; j++) {
|
for (j=1; j<=ndec; j++) {
|
||||||
// piece of edge
|
// piece of edge
|
||||||
m1 = (CutValues.Value(j)-t0)*(last-first)/(t1-t0)+first;
|
m1 = (CutValues.Value(j)-t0)*(last-first)/(t1-t0)+first;
|
||||||
|
if (Abs(m0 - m1) < Precision::Confusion())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
TopoDS_Edge CutE = BRepLib_MakeEdge(C,V0,Vbid,m0,m1);
|
TopoDS_Edge CutE = BRepLib_MakeEdge(C,V0,Vbid,m0,m1);
|
||||||
CutE.Orientation(CurrentOrient);
|
CutE.Orientation(CurrentOrient);
|
||||||
S.Append(CutE);
|
S.Append(CutE);
|
||||||
@@ -358,6 +362,10 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
|
|||||||
V0 = TopExp::LastVertex(CutE);
|
V0 = TopExp::LastVertex(CutE);
|
||||||
if (j==ndec) {
|
if (j==ndec) {
|
||||||
// last piece
|
// last piece
|
||||||
|
if (Abs(m0 - last) < Precision::Confusion())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
TopoDS_Edge LastE = BRepLib_MakeEdge(C,V0,Vl,m0,last);
|
TopoDS_Edge LastE = BRepLib_MakeEdge(C,V0,Vl,m0,last);
|
||||||
LastE.Orientation(CurrentOrient);
|
LastE.Orientation(CurrentOrient);
|
||||||
S.Append(LastE);
|
S.Append(LastE);
|
||||||
@@ -371,6 +379,10 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
|
|||||||
for (j=ndec; j>=1; j--) {
|
for (j=ndec; j>=1; j--) {
|
||||||
// piece of edge
|
// piece of edge
|
||||||
m0 = (CutValues.Value(j)-t0)*(last-first)/(t1-t0)+first;
|
m0 = (CutValues.Value(j)-t0)*(last-first)/(t1-t0)+first;
|
||||||
|
if (Abs(m0 - m1) < Precision::Confusion())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
TopoDS_Edge CutE = BRepLib_MakeEdge(C,Vbid,V1,m0,m1);
|
TopoDS_Edge CutE = BRepLib_MakeEdge(C,Vbid,V1,m0,m1);
|
||||||
CutE.Orientation(CurrentOrient);
|
CutE.Orientation(CurrentOrient);
|
||||||
S.Append(CutE);
|
S.Append(CutE);
|
||||||
@@ -378,6 +390,10 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
|
|||||||
V1 = TopExp::FirstVertex(CutE);
|
V1 = TopExp::FirstVertex(CutE);
|
||||||
if (j==1) {
|
if (j==1) {
|
||||||
// last piece
|
// last piece
|
||||||
|
if (Abs(first - m1) < Precision::Confusion())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
TopoDS_Edge LastE = BRepLib_MakeEdge(C,Vf,V1,first,m1);
|
TopoDS_Edge LastE = BRepLib_MakeEdge(C,Vf,V1,first,m1);
|
||||||
LastE.Orientation(CurrentOrient);
|
LastE.Orientation(CurrentOrient);
|
||||||
S.Append(LastE);
|
S.Append(LastE);
|
||||||
@@ -547,6 +563,10 @@ static Standard_Boolean EdgeIntersectOnWire (const gp_Pnt& P1,
|
|||||||
SR.Clear();
|
SR.Clear();
|
||||||
SR.Append(param);
|
SR.Append(param);
|
||||||
TrimEdge(E,SR,first,last,SO,SE);
|
TrimEdge(E,SR,first,last,SO,SE);
|
||||||
|
if (SE.IsEmpty())
|
||||||
|
{
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
theEdgeNewEdges(E) = SE;
|
theEdgeNewEdges(E) = SE;
|
||||||
TopoDS_Vertex VV1,VV2;
|
TopoDS_Vertex VV1,VV2;
|
||||||
TopExp::Vertices(TopoDS::Edge(SE.Value(1)),VV1,VV2);
|
TopExp::Vertices(TopoDS::Edge(SE.Value(1)),VV1,VV2);
|
||||||
@@ -681,7 +701,7 @@ void BRepFill_CompatibleWires::Init(const TopTools_SequenceOfShape& Sections)
|
|||||||
{
|
{
|
||||||
myInit = Sections;
|
myInit = Sections;
|
||||||
myWork = Sections;
|
myWork = Sections;
|
||||||
myPercent = 0.01;
|
myPercent = 0.1;
|
||||||
myStatus = BRepFill_ThruSectionErrorStatus_NotDone;
|
myStatus = BRepFill_ThruSectionErrorStatus_NotDone;
|
||||||
myMap.Clear();
|
myMap.Clear();
|
||||||
|
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
#include <TopoDS_Vertex.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
#include <TopTools_MapOfShape.hxx>
|
#include <TopTools_MapOfShape.hxx>
|
||||||
#include <ChFi3d.hxx>
|
#include <ChFi3d.hxx>
|
||||||
|
#include <LocalAnalysis_SurfaceContinuity.hxx>
|
||||||
|
|
||||||
static void CorrectOrientationOfTangent(gp_Vec& TangVec,
|
static void CorrectOrientationOfTangent(gp_Vec& TangVec,
|
||||||
const TopoDS_Vertex& aVertex,
|
const TopoDS_Vertex& aVertex,
|
||||||
@@ -50,6 +51,12 @@ static void CorrectOrientationOfTangent(gp_Vec& TangVec,
|
|||||||
if (aVertex.IsSame(Vlast))
|
if (aVertex.IsSame(Vlast))
|
||||||
TangVec.Reverse();
|
TangVec.Reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Standard_Boolean CheckMixedContinuity (const TopoDS_Edge& theEdge,
|
||||||
|
const TopoDS_Face& theFace1,
|
||||||
|
const TopoDS_Face& theFace2,
|
||||||
|
const Standard_Real theAngTol);
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BRepOffset_Analyse
|
//function : BRepOffset_Analyse
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -105,15 +112,168 @@ static void EdgeAnalyse(const TopoDS_Edge& E,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ChFi3d::IsTangentFaces(E, F1, F2)) //weak condition
|
Standard_Boolean isTwoSplines = (aSurfType1 == GeomAbs_BSplineSurface || aSurfType1 == GeomAbs_BezierSurface) &&
|
||||||
ConnectType = ChFiDS_Tangential;
|
(aSurfType2 == GeomAbs_BSplineSurface || aSurfType2 == GeomAbs_BezierSurface);
|
||||||
|
Standard_Boolean isMixedConcavity = Standard_False;
|
||||||
|
if (isTwoSplines)
|
||||||
|
{
|
||||||
|
Standard_Real anAngTol = 0.1;
|
||||||
|
isMixedConcavity = CheckMixedContinuity(E, F1, F2, anAngTol);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isMixedConcavity)
|
||||||
|
{
|
||||||
|
if (ChFi3d::IsTangentFaces(E, F1, F2)) //weak condition
|
||||||
|
{
|
||||||
|
ConnectType = ChFiDS_Tangential;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ConnectType = ChFi3d::DefineConnectType(E, F1, F2, SinTol, Standard_False);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ConnectType = ChFi3d::DefineConnectType(E, F1, F2, SinTol, Standard_False);
|
{
|
||||||
|
ConnectType = ChFiDS_Mixed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
I.Type(ConnectType);
|
I.Type(ConnectType);
|
||||||
LI.Append(I);
|
LI.Append(I);
|
||||||
}
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : CheckMixedConcavity
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean CheckMixedContinuity (const TopoDS_Edge& theEdge,
|
||||||
|
const TopoDS_Face& theFace1,
|
||||||
|
const TopoDS_Face& theFace2,
|
||||||
|
const Standard_Real theAngTol)
|
||||||
|
{
|
||||||
|
Standard_Boolean aMixedCont = Standard_False;
|
||||||
|
GeomAbs_Shape aCurrOrder = BRep_Tool::Continuity(theEdge, theFace1, theFace2);
|
||||||
|
if (aCurrOrder > GeomAbs_C0)
|
||||||
|
{
|
||||||
|
//Method BRep_Tool::Continuity(...) always returns minimal continuity between faces
|
||||||
|
//so, if aCurrOrder > C0 it means that faces are tangent along whole edge.
|
||||||
|
return aMixedCont;
|
||||||
|
}
|
||||||
|
//But we caqnnot trust result, if it is C0. because this value set by default.
|
||||||
|
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));
|
||||||
|
|
||||||
|
Standard_Real aFirst;
|
||||||
|
Standard_Real aLast;
|
||||||
|
|
||||||
|
Handle(Geom2d_Curve) aC2d1, aC2d2;
|
||||||
|
|
||||||
|
if (!theFace1.IsSame(theFace2) &&
|
||||||
|
BRep_Tool::IsClosed(theEdge, theFace1) &&
|
||||||
|
BRep_Tool::IsClosed(theEdge, theFace2))
|
||||||
|
{
|
||||||
|
//Find the edge in the face 1: this edge will have correct orientation
|
||||||
|
TopoDS_Edge anEdgeInFace1;
|
||||||
|
TopoDS_Face aFace1 = theFace1;
|
||||||
|
aFace1.Orientation(TopAbs_FORWARD);
|
||||||
|
TopExp_Explorer anExplo(aFace1, TopAbs_EDGE);
|
||||||
|
for (; anExplo.More(); anExplo.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Edge& anEdge = TopoDS::Edge(anExplo.Current());
|
||||||
|
if (anEdge.IsSame(theEdge))
|
||||||
|
{
|
||||||
|
anEdgeInFace1 = anEdge;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (anEdgeInFace1.IsNull())
|
||||||
|
{
|
||||||
|
return aMixedCont;
|
||||||
|
}
|
||||||
|
|
||||||
|
aC2d1 = BRep_Tool::CurveOnSurface(anEdgeInFace1, aFace1, aFirst, aLast);
|
||||||
|
TopoDS_Face aFace2 = theFace2;
|
||||||
|
aFace2.Orientation(TopAbs_FORWARD);
|
||||||
|
anEdgeInFace1.Reverse();
|
||||||
|
aC2d2 = BRep_Tool::CurveOnSurface(anEdgeInFace1, aFace2, aFirst, aLast);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Obtaining of pcurves of edge on two faces.
|
||||||
|
aC2d1 = BRep_Tool::CurveOnSurface(theEdge, theFace1, aFirst, aLast);
|
||||||
|
//For the case of seam edge
|
||||||
|
TopoDS_Edge EE = theEdge;
|
||||||
|
if (theFace1.IsSame(theFace2))
|
||||||
|
{
|
||||||
|
EE.Reverse();
|
||||||
|
}
|
||||||
|
aC2d2 = BRep_Tool::CurveOnSurface(EE, theFace2, aFirst, aLast);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aC2d1.IsNull() || aC2d2.IsNull())
|
||||||
|
{
|
||||||
|
return aMixedCont;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Obtaining of two surfaces from adjacent faces.
|
||||||
|
Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(theFace1);
|
||||||
|
Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(theFace2);
|
||||||
|
|
||||||
|
if (aSurf1.IsNull() || aSurf2.IsNull())
|
||||||
|
{
|
||||||
|
return aMixedCont;
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Integer aNbSamples = 23;
|
||||||
|
|
||||||
|
// Computation of the continuity.
|
||||||
|
Standard_Real aPar;
|
||||||
|
Standard_Real aDelta = (aLast - aFirst) / (aNbSamples - 1);
|
||||||
|
Standard_Integer i, istart = 1;
|
||||||
|
Standard_Boolean isG1 = Standard_False;
|
||||||
|
|
||||||
|
for (i = 1, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta)
|
||||||
|
{
|
||||||
|
if (i == aNbSamples) aPar = aLast;
|
||||||
|
|
||||||
|
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||||
|
aSurf1, aSurf2, GeomAbs_G1, 0.001, TolC0, theAngTol, theAngTol, theAngTol);
|
||||||
|
if (aCont.IsDone())
|
||||||
|
{
|
||||||
|
istart = i + 1;
|
||||||
|
isG1 = aCont.IsG1();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (istart > aNbSamples / 2)
|
||||||
|
{
|
||||||
|
return aMixedCont;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = istart, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta)
|
||||||
|
{
|
||||||
|
if (i == aNbSamples) aPar = aLast;
|
||||||
|
|
||||||
|
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||||
|
aSurf1, aSurf2, GeomAbs_G1, 0.001, TolC0, theAngTol, theAngTol, theAngTol);
|
||||||
|
if (!aCont.IsDone())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aCont.IsG1() == isG1)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aMixedCont = Standard_True;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return aMixedCont;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BuildAncestors
|
//function : BuildAncestors
|
||||||
|
@@ -29,7 +29,8 @@ enum BRepOffset_Error
|
|||||||
BRepOffset_CannotTrimEdges, //!< exception while trim edges
|
BRepOffset_CannotTrimEdges, //!< exception while trim edges
|
||||||
BRepOffset_CannotFuseVertices, //!< exception while fuse vertices
|
BRepOffset_CannotFuseVertices, //!< exception while fuse vertices
|
||||||
BRepOffset_CannotExtentEdge, //!< exception while extent edges
|
BRepOffset_CannotExtentEdge, //!< exception while extent edges
|
||||||
BRepOffset_UserBreak //!< user break
|
BRepOffset_UserBreak, //!< user break
|
||||||
|
BRepOffset_MixedConnectivity //!< Different connectivity of faces along edge: partially C0 and tangent
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _BRepOffset_Error_HeaderFile
|
#endif // _BRepOffset_Error_HeaderFile
|
||||||
|
@@ -910,6 +910,19 @@ void BRepOffset_MakeOffset::MakeOffsetShape(const Message_ProgressRange& theRang
|
|||||||
myAnalyse.SetFaceOffsetMap (myFaceOffset);
|
myAnalyse.SetFaceOffsetMap (myFaceOffset);
|
||||||
}
|
}
|
||||||
myAnalyse.Perform(myFaceComp,TolAngle, aPS.Next(aSteps(PIOperation_Analyse)));
|
myAnalyse.Perform(myFaceComp,TolAngle, aPS.Next(aSteps(PIOperation_Analyse)));
|
||||||
|
TopExp_Explorer anEExp(myFaceComp, TopAbs_EDGE);
|
||||||
|
for (; anEExp.More(); anEExp.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Edge& anE = TopoDS::Edge(anEExp.Current());
|
||||||
|
const BRepOffset_ListOfInterval& aLI = myAnalyse.Type(anE);
|
||||||
|
if (aLI.IsEmpty())
|
||||||
|
continue;
|
||||||
|
if (aLI.Last().Type() == ChFiDS_Mixed)
|
||||||
|
{
|
||||||
|
myError = BRepOffset_MixedConnectivity;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
{
|
{
|
||||||
myError = BRepOffset_UserBreak;
|
myError = BRepOffset_UserBreak;
|
||||||
@@ -2960,6 +2973,36 @@ void BRepOffset_MakeOffset::MakeMissingWalls (const Message_ProgressRange& theRa
|
|||||||
TopExp::Vertices(anEdge, V1, V2);
|
TopExp::Vertices(anEdge, V1, V2);
|
||||||
Standard_Real aF, aL;
|
Standard_Real aF, aL;
|
||||||
const Handle(Geom_Curve) aC = BRep_Tool::Curve(anEdge, aF, aL);
|
const Handle(Geom_Curve) aC = BRep_Tool::Curve(anEdge, aF, aL);
|
||||||
|
if (V3.IsNull() && V4.IsNull())
|
||||||
|
{
|
||||||
|
// Initially offset edge is created without vertices.
|
||||||
|
// Then edge is trimmed by intersection line between
|
||||||
|
// two adjacent extended offset faces and get vertices.
|
||||||
|
// When intersection lines are invalid for any reason,
|
||||||
|
// (one of reson is mixed connectivity of faces)
|
||||||
|
// algoritm of cutting offset edge by intersection line
|
||||||
|
// can fail and offset edge cannot get vertices.
|
||||||
|
// Follwing workaround is only to avoid exeption if V3 and V4 are Null
|
||||||
|
// Vertex points are invalid.
|
||||||
|
Standard_Real anOEF, anOEL;
|
||||||
|
TopAbs_Orientation anOEOri = OE.Orientation();
|
||||||
|
OE.Orientation(TopAbs_FORWARD);
|
||||||
|
Handle(Geom_Curve) anOEC = BRep_Tool::Curve(OE, anOEF, anOEL);
|
||||||
|
BRep_Builder aBB;
|
||||||
|
gp_Pnt aP1 = anOEC->Value(aF);
|
||||||
|
gp_Pnt aP2 = anOEC->Value(aL);
|
||||||
|
TopoDS_Vertex anOEV1, anOEV2;
|
||||||
|
Standard_Real aTol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2));
|
||||||
|
aBB.MakeVertex(anOEV1, aP1, aTol);
|
||||||
|
anOEV1.Orientation(TopAbs_FORWARD);
|
||||||
|
aBB.MakeVertex(anOEV2, aP2, aTol);
|
||||||
|
anOEV2.Orientation(TopAbs_REVERSED);
|
||||||
|
aBB.Add(OE, anOEV1);
|
||||||
|
aBB.Add(OE, anOEV2);
|
||||||
|
aBB.Range(OE, aF, aL);
|
||||||
|
OE.Orientation(anOEOri);
|
||||||
|
TopExp::Vertices(OE, V4, V3);
|
||||||
|
}
|
||||||
if (!aC.IsNull() &&
|
if (!aC.IsNull() &&
|
||||||
(!aC->IsClosed() && !aC->IsPeriodic()))
|
(!aC->IsClosed() && !aC->IsPeriodic()))
|
||||||
{
|
{
|
||||||
|
@@ -5225,7 +5225,6 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
|
|||||||
const TopTools_ListOfShape* pEOrigins = myOEOrigins.Seek (aE);
|
const TopTools_ListOfShape* pEOrigins = myOEOrigins.Seek (aE);
|
||||||
if (!pEOrigins)
|
if (!pEOrigins)
|
||||||
{
|
{
|
||||||
theMEUseInRebuild.Add (aE);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5393,6 +5392,29 @@ void BRepOffset_BuildOffsetFaces::FindFacesToRebuild()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
//=======================================================================
|
||||||
|
//function : mapShapes
|
||||||
|
//purpose : Collect theVecShapes into theMap with setted theType
|
||||||
|
//=======================================================================
|
||||||
|
template<class Container>
|
||||||
|
static void mapShapes (const Container& theVecShapes,
|
||||||
|
const TopAbs_ShapeEnum theType,
|
||||||
|
TopTools_MapOfShape& theMap)
|
||||||
|
{
|
||||||
|
for (const auto& aShape : theVecShapes)
|
||||||
|
{
|
||||||
|
for (TopExp_Explorer anExp(aShape, theType); anExp.More(); anExp.Next())
|
||||||
|
{
|
||||||
|
theMap.Add(anExp.Current());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IntersectFaces
|
//function : IntersectFaces
|
||||||
//purpose : Intersection of the faces that should be rebuild to resolve all invalidities
|
//purpose : Intersection of the faces that should be rebuild to resolve all invalidities
|
||||||
@@ -5715,7 +5737,10 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
|||||||
TopoDS_Compound aCBE;
|
TopoDS_Compound aCBE;
|
||||||
aBB.MakeCompound (aCBE);
|
aBB.MakeCompound (aCBE);
|
||||||
//
|
//
|
||||||
TopExp_Explorer aExp (aCBInv, TopAbs_EDGE);
|
// remember inside edges and vertices to further check
|
||||||
|
TopTools_MapOfShape anInsideEdges;
|
||||||
|
TopTools_MapOfShape anInsideVertices;
|
||||||
|
TopExp_Explorer aExp(aCBInv, TopAbs_EDGE);
|
||||||
for (; aExp.More(); aExp.Next())
|
for (; aExp.More(); aExp.Next())
|
||||||
{
|
{
|
||||||
const TopoDS_Shape& aE = aExp.Current();
|
const TopoDS_Shape& aE = aExp.Current();
|
||||||
@@ -5724,6 +5749,15 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
|||||||
if (aMEFence.Add (aE))
|
if (aMEFence.Add (aE))
|
||||||
{
|
{
|
||||||
aBB.Add (aCBE, aE);
|
aBB.Add (aCBE, aE);
|
||||||
|
if (!myEdgesToAvoid.Contains(aE) && myInvalidEdges.Contains(aE))
|
||||||
|
{
|
||||||
|
anInsideEdges.Add(aE);
|
||||||
|
TopoDS_Iterator anIt(aE);
|
||||||
|
for (; anIt.More(); anIt.Next())
|
||||||
|
{
|
||||||
|
anInsideVertices.Add(anIt.Value());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5749,10 +5783,6 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
|||||||
TopExp::MapShapes (aCBELoc, TopAbs_EDGE, aME);
|
TopExp::MapShapes (aCBELoc, TopAbs_EDGE, aME);
|
||||||
aMECV = aME;
|
aMECV = aME;
|
||||||
TopExp::MapShapes (aCBELoc, TopAbs_VERTEX, aME);
|
TopExp::MapShapes (aCBELoc, TopAbs_VERTEX, aME);
|
||||||
//
|
|
||||||
// Using the map <aME> find chain of faces to be intersected;
|
|
||||||
//
|
|
||||||
// faces for intersection
|
|
||||||
TopTools_IndexedMapOfShape aMFInt;
|
TopTools_IndexedMapOfShape aMFInt;
|
||||||
// additional faces for intersection
|
// additional faces for intersection
|
||||||
TopTools_IndexedMapOfShape aMFIntExt;
|
TopTools_IndexedMapOfShape aMFIntExt;
|
||||||
@@ -5801,6 +5831,14 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
|||||||
if (pMFInter && !pInterFi)
|
if (pMFInter && !pInterFi)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// create map of edges and vertices for aLFImi
|
||||||
|
TopTools_MapOfShape aMEVIm;
|
||||||
|
mapShapes(*aLFImi, TopAbs_EDGE, aMEVIm);
|
||||||
|
mapShapes(*aLFImi, TopAbs_VERTEX, aMEVIm);
|
||||||
|
|
||||||
|
Standard_Boolean isIContainsE = aMEVIm.HasIntersection(anInsideEdges);
|
||||||
|
Standard_Boolean isIContainsV = aMEVIm.HasIntersection(anInsideVertices);
|
||||||
|
|
||||||
for (j = i + 1; j <= aNb; ++j)
|
for (j = i + 1; j <= aNb; ++j)
|
||||||
{
|
{
|
||||||
const TopoDS_Face& aFj = TopoDS::Face (aMFInt (j));
|
const TopoDS_Face& aFj = TopoDS::Face (aMFInt (j));
|
||||||
@@ -5820,6 +5858,28 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
|||||||
if (!aLFEj)
|
if (!aLFEj)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// create map of edges and vertices for aLFImi
|
||||||
|
aMEVIm.Clear();
|
||||||
|
mapShapes(*aLFImj, TopAbs_EDGE, aMEVIm);
|
||||||
|
mapShapes(*aLFImj, TopAbs_VERTEX, aMEVIm);
|
||||||
|
// check images of both faces contain anInsideEdges and anInsideVertices
|
||||||
|
// not process if false and true
|
||||||
|
Standard_Boolean isJContainsE = aMEVIm.HasIntersection(anInsideEdges);
|
||||||
|
Standard_Boolean isJContainsV = aMEVIm.HasIntersection(anInsideVertices);
|
||||||
|
|
||||||
|
// Check if one face is connected to inside edge then
|
||||||
|
// the other must be also connected
|
||||||
|
if ((isIContainsE && !isJContainsV) ||
|
||||||
|
(isJContainsE && !isIContainsV))
|
||||||
|
{
|
||||||
|
TopTools_ListOfShape aLVC;
|
||||||
|
// it is necessary to process the images if they already have
|
||||||
|
// common vertices
|
||||||
|
FindCommonParts(*aLFImi, *aLFImj, aLVC, TopAbs_VERTEX);
|
||||||
|
|
||||||
|
if (aLVC.IsEmpty())
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// if there are some common edges between faces
|
// if there are some common edges between faces
|
||||||
// we should use these edges and do not intersect again.
|
// we should use these edges and do not intersect again.
|
||||||
|
@@ -281,9 +281,11 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
|
|||||||
|
|
||||||
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
|
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
|
||||||
Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
|
Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
|
||||||
if (C.IsNull() && C2d.IsNull()) {
|
Handle(Poly_Polygon3D) P3d = DrawTrSurf::GetPolygon3D(a[2]);
|
||||||
|
|
||||||
|
if (C.IsNull() && C2d.IsNull() && P3d.IsNull()) {
|
||||||
//std::cout << a[2] << " is not a curve" << std::endl;
|
//std::cout << a[2] << " is not a curve" << std::endl;
|
||||||
di << a[2] << " is not a curve\n";
|
di << a[2] << " is not a curve or polygon 3d\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,7 +293,12 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
|
|||||||
|
|
||||||
if (n == 3) {
|
if (n == 3) {
|
||||||
if (!C.IsNull()) edge = BRepBuilderAPI_MakeEdge(C);
|
if (!C.IsNull()) edge = BRepBuilderAPI_MakeEdge(C);
|
||||||
else edge = BRepBuilderAPI_MakeEdge2d(C2d);
|
else if (!C2d.IsNull()) edge = BRepBuilderAPI_MakeEdge2d(C2d);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BRep_Builder aBB;
|
||||||
|
aBB.MakeEdge(edge, P3d);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Handle(Geom_Surface) S;
|
Handle(Geom_Surface) S;
|
||||||
|
@@ -415,6 +415,11 @@ static void reportOffsetState(Draw_Interpretor& theCommands,
|
|||||||
theCommands << "ERROR. Can not extent edge.";
|
theCommands << "ERROR. Can not extent edge.";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case BRepOffset_MixedConnectivity:
|
||||||
|
{
|
||||||
|
theCommands << "ERROR. Mixed connectivity of faces.";
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
theCommands << "ERROR. offsetperform operation not done.";
|
theCommands << "ERROR. offsetperform operation not done.";
|
||||||
@@ -974,7 +979,10 @@ Standard_Integer thickshell(Draw_Interpretor& theCommands,
|
|||||||
const BRepOffset_Error aRetCode = B.Error();
|
const BRepOffset_Error aRetCode = B.Error();
|
||||||
reportOffsetState(theCommands, aRetCode);
|
reportOffsetState(theCommands, aRetCode);
|
||||||
|
|
||||||
DBRep::Set(a[1], B.Shape());
|
if (!B.Shape().IsNull())
|
||||||
|
{
|
||||||
|
DBRep::Set(a[1], B.Shape());
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1109,7 +1117,10 @@ Standard_Integer offsetshape(Draw_Interpretor& theCommands,
|
|||||||
const BRepOffset_Error aRetCode = B.Error();
|
const BRepOffset_Error aRetCode = B.Error();
|
||||||
reportOffsetState(theCommands, aRetCode);
|
reportOffsetState(theCommands, aRetCode);
|
||||||
|
|
||||||
DBRep::Set(a[1], B.Shape());
|
if (!B.Shape().IsNull())
|
||||||
|
{
|
||||||
|
DBRep::Set(a[1], B.Shape());
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -692,7 +692,6 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
|||||||
else{
|
else{
|
||||||
sst = Spine->LastStatus();
|
sst = Spine->LastStatus();
|
||||||
iedge = Spine->NbEdges();
|
iedge = Spine->NbEdges();
|
||||||
E[0] = Spine->Edges(iedge);
|
|
||||||
V = Spine->LastVertex();
|
V = Spine->LastVertex();
|
||||||
}
|
}
|
||||||
//Before all it is checked if the tangency is not dead.
|
//Before all it is checked if the tangency is not dead.
|
||||||
@@ -703,6 +702,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(sst == ChFiDS_BreakPoint){
|
if(sst == ChFiDS_BreakPoint){
|
||||||
|
Standard_Integer aLocNbG1Connections = 0;
|
||||||
TopTools_ListIteratorOfListOfShape It;//,Jt;
|
TopTools_ListIteratorOfListOfShape It;//,Jt;
|
||||||
Standard_Boolean sommetpourri = Standard_False;
|
Standard_Boolean sommetpourri = Standard_False;
|
||||||
TopTools_IndexedMapOfOrientedShape EdgesOfV;
|
TopTools_IndexedMapOfOrientedShape EdgesOfV;
|
||||||
@@ -720,7 +720,10 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
|||||||
if (!F2.IsNull() && ChFi3d::IsTangentFaces(anEdge, F1, F2, GeomAbs_G2)) //smooth edge
|
if (!F2.IsNull() && ChFi3d::IsTangentFaces(anEdge, F1, F2, GeomAbs_G2)) //smooth edge
|
||||||
{
|
{
|
||||||
if (!F1.IsSame(F2))
|
if (!F1.IsSame(F2))
|
||||||
|
{
|
||||||
NbG1Connections++;
|
NbG1Connections++;
|
||||||
|
aLocNbG1Connections++;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -759,7 +762,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
|||||||
if (EdgesOfV.Extent() != 3)
|
if (EdgesOfV.Extent() != 3)
|
||||||
sommetpourri = Standard_True;
|
sommetpourri = Standard_True;
|
||||||
|
|
||||||
if(!sommetpourri){
|
if(!sommetpourri && aLocNbG1Connections < 4){
|
||||||
sst = ChFi3d_EdgeState(E,myEFMap);
|
sst = ChFi3d_EdgeState(E,myEFMap);
|
||||||
}
|
}
|
||||||
if(ii==1)Spine->SetFirstStatus(sst);
|
if(ii==1)Spine->SetFirstStatus(sst);
|
||||||
|
@@ -24,7 +24,8 @@ ChFiDS_Concave,
|
|||||||
ChFiDS_Convex,
|
ChFiDS_Convex,
|
||||||
ChFiDS_Tangential,
|
ChFiDS_Tangential,
|
||||||
ChFiDS_FreeBound,
|
ChFiDS_FreeBound,
|
||||||
ChFiDS_Other
|
ChFiDS_Other,
|
||||||
|
ChFiDS_Mixed
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _ChFiDS_TypeOfConcavity_HeaderFile
|
#endif // _ChFiDS_TypeOfConcavity_HeaderFile
|
||||||
|
@@ -88,8 +88,11 @@ bool DE_ConfigurationNode::Save(const TCollection_AsciiString& theResourcePath)
|
|||||||
// function : UpdateLoad
|
// function : UpdateLoad
|
||||||
// purpose :
|
// purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool DE_ConfigurationNode::UpdateLoad()
|
bool DE_ConfigurationNode::UpdateLoad(const Standard_Boolean theToImport,
|
||||||
|
const Standard_Boolean theToKeep)
|
||||||
{
|
{
|
||||||
|
(void)theToImport;
|
||||||
|
(void)theToKeep;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,9 +85,12 @@ public:
|
|||||||
//! @return new object with the same field values
|
//! @return new object with the same field values
|
||||||
Standard_EXPORT virtual Handle(DE_ConfigurationNode) Copy() const = 0;
|
Standard_EXPORT virtual Handle(DE_ConfigurationNode) Copy() const = 0;
|
||||||
|
|
||||||
//! Update loading status. Checking for the license.
|
//! Update loading status. Checking for the ability to read and write.
|
||||||
|
//! @param[in] theToImport flag to updates for import. Standard_True-import, Standard_False-export
|
||||||
|
//! @param[in] theToKeep flag to save update result
|
||||||
//! @return Standard_True, if node can be used
|
//! @return Standard_True, if node can be used
|
||||||
Standard_EXPORT virtual bool UpdateLoad();
|
Standard_EXPORT virtual bool UpdateLoad(const Standard_Boolean theToImport,
|
||||||
|
const Standard_Boolean theToKeep);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@@ -44,6 +44,7 @@ namespace
|
|||||||
// purpose :
|
// purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
DE_Wrapper::DE_Wrapper()
|
DE_Wrapper::DE_Wrapper()
|
||||||
|
:myKeepUpdates(Standard_False)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -67,6 +68,7 @@ DE_Wrapper::DE_Wrapper(const Handle(DE_Wrapper)& theWrapper)
|
|||||||
Bind(aVendorIter.Value());
|
Bind(aVendorIter.Value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
theWrapper->myKeepUpdates = myKeepUpdates;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -445,7 +447,6 @@ void DE_Wrapper::ChangePriority(const TCollection_AsciiString& theFormat,
|
|||||||
if (aVendorMap.FindFromKey(aVendorName, aNode))
|
if (aVendorMap.FindFromKey(aVendorName, aNode))
|
||||||
{
|
{
|
||||||
aNode->SetEnabled(Standard_True);
|
aNode->SetEnabled(Standard_True);
|
||||||
aNode->UpdateLoad();
|
|
||||||
aNewVendorMap.Add(aVendorName, aNode);
|
aNewVendorMap.Add(aVendorName, aNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -532,7 +533,8 @@ Standard_Boolean DE_Wrapper::FindProvider(const TCollection_AsciiString& thePath
|
|||||||
((theToImport && aNode->IsImportSupported()) ||
|
((theToImport && aNode->IsImportSupported()) ||
|
||||||
(!theToImport && aNode->IsExportSupported())) &&
|
(!theToImport && aNode->IsExportSupported())) &&
|
||||||
(aNode->CheckExtension(anExtr) ||
|
(aNode->CheckExtension(anExtr) ||
|
||||||
(theToImport && aNode->CheckContent(aBuffer))))
|
(theToImport && aNode->CheckContent(aBuffer))) &&
|
||||||
|
aNode->UpdateLoad(theToImport, myKeepUpdates))
|
||||||
{
|
{
|
||||||
theProvider = aNode->BuildProvider();
|
theProvider = aNode->BuildProvider();
|
||||||
aNode->GlobalParameters = GlobalParameters;
|
aNode->GlobalParameters = GlobalParameters;
|
||||||
@@ -544,6 +546,28 @@ Standard_Boolean DE_Wrapper::FindProvider(const TCollection_AsciiString& thePath
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : UpdateLoad
|
||||||
|
// purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_EXPORT void DE_Wrapper::UpdateLoad(const Standard_Boolean theToForceUpdate) const
|
||||||
|
{
|
||||||
|
for (DE_ConfigurationFormatMap::Iterator aFormatIter(myConfiguration);
|
||||||
|
aFormatIter.More(); aFormatIter.Next())
|
||||||
|
{
|
||||||
|
for (DE_ConfigurationVendorMap::Iterator aVendorIter(aFormatIter.Value());
|
||||||
|
aVendorIter.More(); aVendorIter.Next())
|
||||||
|
{
|
||||||
|
const Handle(DE_ConfigurationNode)& aNode = aVendorIter.Value();
|
||||||
|
aNode->UpdateLoad(Standard_True, Standard_True);
|
||||||
|
aNode->UpdateLoad(Standard_False, Standard_True);
|
||||||
|
if (!theToForceUpdate)
|
||||||
|
continue;
|
||||||
|
aNode->SetEnabled(aNode->IsExportSupported() || aNode->IsImportSupported());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : sort
|
// function : sort
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@@ -226,6 +226,16 @@ public:
|
|||||||
const Standard_Boolean theToImport,
|
const Standard_Boolean theToImport,
|
||||||
Handle(DE_Provider)& theProvider) const;
|
Handle(DE_Provider)& theProvider) const;
|
||||||
|
|
||||||
|
//! Updates all registered nodes, all changes will be saved in nodes
|
||||||
|
//! @param[in] theToForceUpdate flag that turns on/of nodes, according to updated ability to import/export
|
||||||
|
Standard_EXPORT void UpdateLoad(const Standard_Boolean theToForceUpdate = Standard_False) const;
|
||||||
|
|
||||||
|
//! Gets flag that keeps changes on configuration nodes which are being updated, false by default
|
||||||
|
Standard_Boolean KeepUpdates() const { return myKeepUpdates; }
|
||||||
|
|
||||||
|
//! Sets flag that keeps changes on configuration nodes which are being updated, false by default
|
||||||
|
void SetKeepUpdates(const Standard_Boolean theToKeepUpdates) { myKeepUpdates = theToKeepUpdates; }
|
||||||
|
|
||||||
//! Gets format map, contains vendor map with nodes
|
//! Gets format map, contains vendor map with nodes
|
||||||
//! @return internal map of formats
|
//! @return internal map of formats
|
||||||
Standard_EXPORT const DE_ConfigurationFormatMap& Nodes() const;
|
Standard_EXPORT const DE_ConfigurationFormatMap& Nodes() const;
|
||||||
@@ -248,6 +258,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Standard_Boolean myKeepUpdates; //!< Flag that keeps changes on configuration nodes which are being updated
|
||||||
DE_ConfigurationFormatMap myConfiguration; //!< Internal map of formats
|
DE_ConfigurationFormatMap myConfiguration; //!< Internal map of formats
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -34,9 +34,7 @@ namespace
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
DEBRepCascade_ConfigurationNode::DEBRepCascade_ConfigurationNode() :
|
DEBRepCascade_ConfigurationNode::DEBRepCascade_ConfigurationNode() :
|
||||||
DE_ConfigurationNode()
|
DE_ConfigurationNode()
|
||||||
{
|
{}
|
||||||
UpdateLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : DEBRepCascade_ConfigurationNode
|
// function : DEBRepCascade_ConfigurationNode
|
||||||
@@ -46,7 +44,6 @@ DEBRepCascade_ConfigurationNode::DEBRepCascade_ConfigurationNode(const Handle(DE
|
|||||||
:DE_ConfigurationNode(theNode)
|
:DE_ConfigurationNode(theNode)
|
||||||
{
|
{
|
||||||
InternalParameters = theNode->InternalParameters;
|
InternalParameters = theNode->InternalParameters;
|
||||||
UpdateLoad();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -34,9 +34,7 @@ namespace
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
DEXCAFCascade_ConfigurationNode::DEXCAFCascade_ConfigurationNode() :
|
DEXCAFCascade_ConfigurationNode::DEXCAFCascade_ConfigurationNode() :
|
||||||
DE_ConfigurationNode()
|
DE_ConfigurationNode()
|
||||||
{
|
{}
|
||||||
UpdateLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : DEXCAFCascade_ConfigurationNode
|
// function : DEXCAFCascade_ConfigurationNode
|
||||||
@@ -46,7 +44,6 @@ DEXCAFCascade_ConfigurationNode::DEXCAFCascade_ConfigurationNode(const Handle(DE
|
|||||||
:DE_ConfigurationNode(theNode)
|
:DE_ConfigurationNode(theNode)
|
||||||
{
|
{
|
||||||
InternalParameters = theNode->InternalParameters;
|
InternalParameters = theNode->InternalParameters;
|
||||||
UpdateLoad();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -429,6 +429,8 @@ static Standard_Boolean ConicDefinition
|
|||||||
term2 = -gdet/(cprim*pdet);
|
term2 = -gdet/(cprim*pdet);
|
||||||
|
|
||||||
if (IsEllip) {
|
if (IsEllip) {
|
||||||
|
if (term1 <= eps || term2 <= eps)
|
||||||
|
return Standard_False;
|
||||||
Xax = cost;
|
Xax = cost;
|
||||||
Yax = sint;
|
Yax = sint;
|
||||||
Rmin = sqrt ( term1);
|
Rmin = sqrt ( term1);
|
||||||
@@ -439,12 +441,16 @@ static Standard_Boolean ConicDefinition
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (term1 <= eps){
|
else if (term1 <= eps){
|
||||||
|
if (-term1 <= eps || term2 <= eps)
|
||||||
|
return Standard_False;
|
||||||
Xax = -sint;
|
Xax = -sint;
|
||||||
Yax = cost;
|
Yax = cost;
|
||||||
Rmin = sqrt (-term1);
|
Rmin = sqrt (-term1);
|
||||||
Rmax = sqrt (term2);
|
Rmax = sqrt (term2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (term1 <= eps || -term2 <= eps)
|
||||||
|
return Standard_False;
|
||||||
Xax = cost;
|
Xax = cost;
|
||||||
Yax = sint;
|
Yax = sint;
|
||||||
Rmin = sqrt (-term2);
|
Rmin = sqrt (-term2);
|
||||||
|
@@ -93,6 +93,15 @@ public:
|
|||||||
//! converts RLine to Geom(2d)_Curve.
|
//! converts RLine to Geom(2d)_Curve.
|
||||||
Standard_EXPORT static void TreatRLine (const Handle(IntPatch_RLine)& theRL, const Handle(GeomAdaptor_Surface)& theHS1, const Handle(GeomAdaptor_Surface)& theHS2, Handle(Geom_Curve)& theC3d, Handle(Geom2d_Curve)& theC2d1, Handle(Geom2d_Curve)& theC2d2, Standard_Real& theTolReached);
|
Standard_EXPORT static void TreatRLine (const Handle(IntPatch_RLine)& theRL, const Handle(GeomAdaptor_Surface)& theHS1, const Handle(GeomAdaptor_Surface)& theHS2, Handle(Geom_Curve)& theC3d, Handle(Geom2d_Curve)& theC2d1, Handle(Geom2d_Curve)& theC2d2, Standard_Real& theTolReached);
|
||||||
|
|
||||||
|
//! creates 2D-curve on given surface from given 3D-curve
|
||||||
|
Standard_EXPORT static void BuildPCurves (const Standard_Real theFirst, const Standard_Real theLast,
|
||||||
|
const Standard_Real theUmin, const Standard_Real theUmax,
|
||||||
|
const Standard_Real theVmin, const Standard_Real theVmax,
|
||||||
|
Standard_Real& theTol,
|
||||||
|
const Handle(Geom_Surface)& theSurface,
|
||||||
|
const Handle(Geom_Curve)& theCurve,
|
||||||
|
Handle(Geom2d_Curve)& theCurve2d);
|
||||||
|
|
||||||
//! creates 2D-curve on given surface from given 3D-curve
|
//! creates 2D-curve on given surface from given 3D-curve
|
||||||
Standard_EXPORT static void BuildPCurves (const Standard_Real f, const Standard_Real l, Standard_Real& Tol, const Handle(Geom_Surface)& S, const Handle(Geom_Curve)& C, Handle(Geom2d_Curve)& C2d);
|
Standard_EXPORT static void BuildPCurves (const Standard_Real f, const Standard_Real l, Standard_Real& Tol, const Handle(Geom_Surface)& S, const Handle(Geom_Curve)& C, Handle(Geom2d_Curve)& C2d);
|
||||||
|
|
||||||
|
@@ -1074,94 +1074,92 @@ void GeomInt_IntSS::TreatRLine(const Handle(IntPatch_RLine)& theRL,
|
|||||||
//function : BuildPCurves
|
//function : BuildPCurves
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GeomInt_IntSS::BuildPCurves (Standard_Real f,
|
void GeomInt_IntSS::BuildPCurves (const Standard_Real theFirst, const Standard_Real theLast,
|
||||||
Standard_Real l,
|
const Standard_Real theUmin, const Standard_Real theUmax,
|
||||||
Standard_Real& Tol,
|
const Standard_Real theVmin, const Standard_Real theVmax,
|
||||||
const Handle (Geom_Surface)& S,
|
Standard_Real& theTol,
|
||||||
const Handle (Geom_Curve)& C,
|
const Handle(Geom_Surface)& theSurface,
|
||||||
Handle (Geom2d_Curve)& C2d)
|
const Handle(Geom_Curve)& theCurve,
|
||||||
|
Handle(Geom2d_Curve)& theCurve2d)
|
||||||
{
|
{
|
||||||
if (!C2d.IsNull()) {
|
if (!theCurve2d.IsNull() || theSurface.IsNull()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
Standard_Real umin,umax,vmin,vmax;
|
|
||||||
//
|
|
||||||
S->Bounds(umin, umax, vmin, vmax);
|
|
||||||
// in class ProjLib_Function the range of parameters is shrank by 1.e-09
|
// in class ProjLib_Function the range of parameters is shrank by 1.e-09
|
||||||
if((l - f) > 2.e-09) {
|
if ((theLast - theFirst) > 2.e-09) {
|
||||||
C2d = GeomProjLib::Curve2d(C,f,l,S,umin,umax,vmin,vmax,Tol);
|
theCurve2d = GeomProjLib::Curve2d(theCurve, theFirst, theLast, theSurface, theUmin, theUmax, theVmin, theVmax, theTol);
|
||||||
if (C2d.IsNull()) {
|
if (theCurve2d.IsNull()) {
|
||||||
// proj. a circle that goes through the pole on a sphere to the sphere
|
// proj. a circle that goes through the pole on a sphere to the sphere
|
||||||
Tol += Precision::Confusion();
|
theTol += Precision::Confusion();
|
||||||
C2d = GeomProjLib::Curve2d(C,f,l,S,Tol);
|
theCurve2d = GeomProjLib::Curve2d(theCurve, theFirst, theLast, theSurface, theTol);
|
||||||
}
|
}
|
||||||
const Handle(Standard_Type)& aType = C2d->DynamicType();
|
const Handle(Standard_Type)& aType = theCurve2d->DynamicType();
|
||||||
if ( aType == STANDARD_TYPE(Geom2d_BSplineCurve))
|
if (aType == STANDARD_TYPE(Geom2d_BSplineCurve))
|
||||||
{
|
{
|
||||||
//Check first, last knots to avoid problems with trimming
|
//Check first, last knots to avoid problems with trimming
|
||||||
//First, last knots can differ from f, l because of numerical error
|
//First, last knots can differ from f, l because of numerical error
|
||||||
//of projection and approximation
|
//of projection and approximation
|
||||||
//The same checking as in Geom2d_TrimmedCurve
|
//The same checking as in Geom2d_TrimmedCurve
|
||||||
if((C2d->FirstParameter() - f > Precision::PConfusion()) ||
|
if ((theCurve2d->FirstParameter() - theFirst > Precision::PConfusion()) ||
|
||||||
(l - C2d->LastParameter() > Precision::PConfusion()))
|
(theLast - theCurve2d->LastParameter() > Precision::PConfusion()))
|
||||||
{
|
{
|
||||||
Handle(Geom2d_BSplineCurve) aBspl = Handle(Geom2d_BSplineCurve)::DownCast(C2d);
|
Handle(Geom2d_BSplineCurve) aBspl = Handle(Geom2d_BSplineCurve)::DownCast(theCurve2d);
|
||||||
TColStd_Array1OfReal aKnots(1, aBspl->NbKnots());
|
TColStd_Array1OfReal aKnots(1, aBspl->NbKnots());
|
||||||
aBspl->Knots(aKnots);
|
aBspl->Knots(aKnots);
|
||||||
BSplCLib::Reparametrize(f, l, aKnots);
|
BSplCLib::Reparametrize(theFirst, theLast, aKnots);
|
||||||
aBspl->SetKnots(aKnots);
|
aBspl->SetKnots(aKnots);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if((l - f) > Epsilon(Abs(f)))
|
if ((theLast - theFirst) > Epsilon(Abs(theFirst)))
|
||||||
{
|
{
|
||||||
//The domain of C2d is [Epsilon(Abs(f)), 2.e-09]
|
//The domain of C2d is [Epsilon(Abs(f)), 2.e-09]
|
||||||
//On this small range C2d can be considered as segment
|
//On this small range C2d can be considered as segment
|
||||||
//of line.
|
//of line.
|
||||||
|
|
||||||
Standard_Real aU=0., aV=0.;
|
Standard_Real aU = 0., aV = 0.;
|
||||||
GeomAdaptor_Surface anAS;
|
GeomAdaptor_Surface anAS;
|
||||||
anAS.Load(S);
|
anAS.Load(theSurface);
|
||||||
Extrema_ExtPS anExtr;
|
Extrema_ExtPS anExtr;
|
||||||
const gp_Pnt aP3d1 = C->Value(f);
|
const gp_Pnt aP3d1 = theCurve->Value(theFirst);
|
||||||
const gp_Pnt aP3d2 = C->Value(l);
|
const gp_Pnt aP3d2 = theCurve->Value(theLast);
|
||||||
|
|
||||||
anExtr.SetAlgo(Extrema_ExtAlgo_Grad);
|
anExtr.SetAlgo(Extrema_ExtAlgo_Grad);
|
||||||
anExtr.Initialize(anAS, umin, umax, vmin, vmax,
|
anExtr.Initialize(anAS, theUmin, theUmax, theVmin, theVmax,
|
||||||
Precision::Confusion(), Precision::Confusion());
|
Precision::Confusion(), Precision::Confusion());
|
||||||
anExtr.Perform(aP3d1);
|
anExtr.Perform(aP3d1);
|
||||||
|
|
||||||
if(ParametersOfNearestPointOnSurface(anExtr, aU, aV))
|
if (ParametersOfNearestPointOnSurface(anExtr, aU, aV))
|
||||||
{
|
{
|
||||||
const gp_Pnt2d aP2d1(aU, aV);
|
const gp_Pnt2d aP2d1(aU, aV);
|
||||||
|
|
||||||
anExtr.Perform(aP3d2);
|
anExtr.Perform(aP3d2);
|
||||||
|
|
||||||
if(ParametersOfNearestPointOnSurface(anExtr, aU, aV))
|
if (ParametersOfNearestPointOnSurface(anExtr, aU, aV))
|
||||||
{
|
{
|
||||||
const gp_Pnt2d aP2d2(aU, aV);
|
const gp_Pnt2d aP2d2(aU, aV);
|
||||||
|
|
||||||
if(aP2d1.Distance(aP2d2) > gp::Resolution())
|
if (aP2d1.Distance(aP2d2) > gp::Resolution())
|
||||||
{
|
{
|
||||||
TColgp_Array1OfPnt2d poles(1,2);
|
TColgp_Array1OfPnt2d poles(1, 2);
|
||||||
TColStd_Array1OfReal knots(1,2);
|
TColStd_Array1OfReal knots(1, 2);
|
||||||
TColStd_Array1OfInteger mults(1,2);
|
TColStd_Array1OfInteger mults(1, 2);
|
||||||
poles(1) = aP2d1;
|
poles(1) = aP2d1;
|
||||||
poles(2) = aP2d2;
|
poles(2) = aP2d2;
|
||||||
knots(1) = f;
|
knots(1) = theFirst;
|
||||||
knots(2) = l;
|
knots(2) = theLast;
|
||||||
mults(1) = mults(2) = 2;
|
mults(1) = mults(2) = 2;
|
||||||
|
|
||||||
C2d = new Geom2d_BSplineCurve(poles,knots,mults,1);
|
theCurve2d = new Geom2d_BSplineCurve(poles, knots, mults, 1);
|
||||||
|
|
||||||
//Check same parameter in middle point .begin
|
//Check same parameter in middle point .begin
|
||||||
const gp_Pnt PMid(C->Value(0.5*(f+l)));
|
const gp_Pnt PMid(theCurve->Value(0.5*(theFirst + theLast)));
|
||||||
const gp_Pnt2d pmidcurve2d(0.5*(aP2d1.XY() + aP2d2.XY()));
|
const gp_Pnt2d pmidcurve2d(0.5*(aP2d1.XY() + aP2d2.XY()));
|
||||||
const gp_Pnt aPC(anAS.Value(pmidcurve2d.X(), pmidcurve2d.Y()));
|
const gp_Pnt aPC(anAS.Value(pmidcurve2d.X(), pmidcurve2d.Y()));
|
||||||
const Standard_Real aDist = PMid.Distance(aPC);
|
const Standard_Real aDist = PMid.Distance(aPC);
|
||||||
Tol = Max(aDist, Tol);
|
theTol = Max(aDist, theTol);
|
||||||
//Check same parameter in middle point .end
|
//Check same parameter in middle point .end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1169,27 +1167,51 @@ void GeomInt_IntSS::BuildPCurves (Standard_Real f,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (S->IsUPeriodic() && !C2d.IsNull()) {
|
if (theSurface->IsUPeriodic() && !theCurve2d.IsNull()) {
|
||||||
// Recadre dans le domaine UV de la face
|
// Recadre dans le domaine UV de la face
|
||||||
Standard_Real aTm, U0, aEps, period, du, U0x;
|
Standard_Real aTm, U0, aEps, period, du, U0x;
|
||||||
Standard_Boolean bAdjust;
|
Standard_Boolean bAdjust;
|
||||||
//
|
//
|
||||||
aEps = Precision::PConfusion();
|
aEps = Precision::PConfusion();
|
||||||
period = S->UPeriod();
|
period = theSurface->UPeriod();
|
||||||
//
|
//
|
||||||
aTm = .5*(f + l);
|
aTm = .5 * (theFirst + theLast);
|
||||||
gp_Pnt2d pm = C2d->Value(aTm);
|
gp_Pnt2d pm = theCurve2d->Value(aTm);
|
||||||
U0 = pm.X();
|
U0 = pm.X();
|
||||||
//
|
//
|
||||||
bAdjust =
|
bAdjust =
|
||||||
GeomInt::AdjustPeriodic(U0, umin, umax, period, U0x, du, aEps);
|
GeomInt::AdjustPeriodic(U0, theUmin, theUmax, period, U0x, du, aEps);
|
||||||
if (bAdjust) {
|
if (bAdjust) {
|
||||||
gp_Vec2d T1(du, 0.);
|
gp_Vec2d T1(du, 0.);
|
||||||
C2d->Translate(T1);
|
theCurve2d->Translate(T1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : BuildPCurves
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GeomInt_IntSS::BuildPCurves (const Standard_Real f,
|
||||||
|
const Standard_Real l,
|
||||||
|
Standard_Real& Tol,
|
||||||
|
const Handle (Geom_Surface)& S,
|
||||||
|
const Handle (Geom_Curve)& C,
|
||||||
|
Handle (Geom2d_Curve)& C2d)
|
||||||
|
{
|
||||||
|
if (!C2d.IsNull() || S.IsNull()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
Standard_Real umin,umax,vmin,vmax;
|
||||||
|
//
|
||||||
|
S->Bounds(umin, umax, vmin, vmax);
|
||||||
|
|
||||||
|
BuildPCurves(f, l, umin, umax, vmin, vmax, Tol, S, C, C2d);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : TrimILineOnSurfBoundaries
|
//function : TrimILineOnSurfBoundaries
|
||||||
//purpose : This function finds intersection points of given curves with
|
//purpose : This function finds intersection points of given curves with
|
||||||
|
@@ -34,9 +34,7 @@ namespace
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode() :
|
IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode() :
|
||||||
DE_ConfigurationNode()
|
DE_ConfigurationNode()
|
||||||
{
|
{}
|
||||||
UpdateLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : IGESCAFControl_ConfigurationNode
|
// function : IGESCAFControl_ConfigurationNode
|
||||||
@@ -46,7 +44,6 @@ IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode(const Handle(
|
|||||||
:DE_ConfigurationNode(theNode)
|
:DE_ConfigurationNode(theNode)
|
||||||
{
|
{
|
||||||
InternalParameters = theNode->InternalParameters;
|
InternalParameters = theNode->InternalParameters;
|
||||||
UpdateLoad();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -50,11 +50,21 @@
|
|||||||
#include <Standard_DomainError.hxx>
|
#include <Standard_DomainError.hxx>
|
||||||
#include <Standard_OutOfRange.hxx>
|
#include <Standard_OutOfRange.hxx>
|
||||||
#include <StdFail_NotDone.hxx>
|
#include <StdFail_NotDone.hxx>
|
||||||
|
#include <gce_MakePln.hxx>
|
||||||
|
#include <ProjLib.hxx>
|
||||||
|
#include <IntAna2d_AnaIntersection.hxx>
|
||||||
|
#include <IntAna2d_IntPoint.hxx>
|
||||||
|
|
||||||
|
#ifdef DEBUGLINES
|
||||||
|
#include <Geom2d_Line.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
static
|
static
|
||||||
gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D);
|
gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D);
|
||||||
static
|
static
|
||||||
void RefineDir(gp_Dir& aDir);
|
void RefineDir(gp_Dir& aDir);
|
||||||
|
static
|
||||||
|
Standard_Real EstimDist(const gp_Cone& theCon1, const gp_Cone& theCon2);
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : AxeOperator
|
//class : AxeOperator
|
||||||
@@ -249,6 +259,72 @@ gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D)
|
|||||||
return(gp_Ax2(P,D,gp_Dir(gp_Vec(-y,x,0.0))));
|
return(gp_Ax2(P,D,gp_Dir(gp_Vec(-y,x,0.0))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : EstimDist
|
||||||
|
//purpose : returns a minimal distance from apex to any solution
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Real EstimDist(const gp_Cone& theCon1, const gp_Cone& theCon2)
|
||||||
|
{
|
||||||
|
//It is supposed that axes of cones are coplanar and
|
||||||
|
//distance between them > Precision::Confusion()
|
||||||
|
gp_Pnt aPA1 = theCon1.Apex(), aPA2 = theCon2.Apex();
|
||||||
|
|
||||||
|
gp_Pnt aP3 = aPA1.Translated(theCon1.Position().Direction());
|
||||||
|
|
||||||
|
gce_MakePln aMkPln(aPA1, aPA2, aP3);
|
||||||
|
if(!aMkPln.IsDone())
|
||||||
|
return Precision::Infinite();
|
||||||
|
|
||||||
|
const gp_Pln& aPln = aMkPln.Value();
|
||||||
|
|
||||||
|
gp_Lin anAx1(aPA1, theCon1.Position().Direction());
|
||||||
|
gp_Lin2d anAx12d = ProjLib::Project(aPln, anAx1);
|
||||||
|
gp_Lin2d Lines1[2];
|
||||||
|
Standard_Real anAng1 = theCon1.SemiAngle();
|
||||||
|
Lines1[0] = anAx12d.Rotated(anAx12d.Location(), anAng1);
|
||||||
|
Lines1[1] = anAx12d.Rotated(anAx12d.Location(), -anAng1);
|
||||||
|
//
|
||||||
|
gp_Lin anAx2(aPA2, theCon2.Position().Direction());
|
||||||
|
gp_Lin2d anAx22d = ProjLib::Project(aPln, anAx2);
|
||||||
|
gp_Lin2d Lines2[2];
|
||||||
|
Standard_Real anAng2 = theCon2.SemiAngle();
|
||||||
|
Lines2[0] = anAx22d.Rotated(anAx22d.Location(), anAng2);
|
||||||
|
Lines2[1] = anAx22d.Rotated(anAx22d.Location(), -anAng2);
|
||||||
|
|
||||||
|
#ifdef DEBUGLINES
|
||||||
|
Handle(Geom2d_Line) L10 = new Geom2d_Line(Lines1[0]);
|
||||||
|
Handle(Geom2d_Line) L11 = new Geom2d_Line(Lines1[1]);
|
||||||
|
Handle(Geom2d_Line) L20 = new Geom2d_Line(Lines2[0]);
|
||||||
|
Handle(Geom2d_Line) L21 = new Geom2d_Line(Lines2[1]);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Standard_Real aMinDist[2] = { Precision::Infinite(), Precision::Infinite() };
|
||||||
|
Standard_Integer i, j, k;
|
||||||
|
IntAna2d_AnaIntersection anInter;
|
||||||
|
for (i = 0; i < 2; ++i)
|
||||||
|
{
|
||||||
|
for (j = 0; j < 2; ++j)
|
||||||
|
{
|
||||||
|
anInter.Perform(Lines1[i], Lines2[j]);
|
||||||
|
if (anInter.IsDone())
|
||||||
|
{
|
||||||
|
Standard_Integer aNbPoints = anInter.NbPoints();
|
||||||
|
for (k = 1; k <= aNbPoints; ++k)
|
||||||
|
{
|
||||||
|
const IntAna2d_IntPoint& anIntP = anInter.Point(k);
|
||||||
|
Standard_Real aPar1 = Abs(anIntP.ParamOnFirst());
|
||||||
|
aMinDist[0] = Min(aPar1, aMinDist[0]);
|
||||||
|
Standard_Real aPar2 = Abs(anIntP.ParamOnSecond());
|
||||||
|
aMinDist[1] = Min(aPar2, aMinDist[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Real aDist = Max(aMinDist[0], aMinDist[1]);
|
||||||
|
return aDist;
|
||||||
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IntAna_QuadQuadGeo
|
//function : IntAna_QuadQuadGeo
|
||||||
//purpose : Empty constructor
|
//purpose : Empty constructor
|
||||||
@@ -1356,30 +1432,49 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1,
|
void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1,
|
||||||
const gp_Cone& Con2,
|
const gp_Cone& Con2,
|
||||||
const Standard_Real Tol)
|
const Standard_Real Tol)
|
||||||
{
|
{
|
||||||
done=Standard_True;
|
done = Standard_True;
|
||||||
//
|
//
|
||||||
Standard_Real tg1, tg2, aDA1A2, aTol2;
|
Standard_Real tg1, tg2, aDA1A2, aTol2;
|
||||||
gp_Pnt aPApex1, aPApex2;
|
gp_Pnt aPApex1, aPApex2;
|
||||||
|
|
||||||
Standard_Real TOL_APEX_CONF = 1.e-10;
|
Standard_Real TOL_APEX_CONF = 1.e-10;
|
||||||
|
|
||||||
//
|
|
||||||
tg1=Tan(Con1.SemiAngle());
|
|
||||||
tg2=Tan(Con2.SemiAngle());
|
|
||||||
|
|
||||||
if((tg1 * tg2) < 0.) {
|
//
|
||||||
|
tg1 = Tan(Con1.SemiAngle());
|
||||||
|
tg2 = Tan(Con2.SemiAngle());
|
||||||
|
|
||||||
|
if ((tg1 * tg2) < 0.) {
|
||||||
tg2 = -tg2;
|
tg2 = -tg2;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
aTol2=Tol*Tol;
|
aTol2 = Tol*Tol;
|
||||||
aPApex1=Con1.Apex();
|
aPApex1 = Con1.Apex();
|
||||||
aPApex2=Con2.Apex();
|
aPApex2 = Con2.Apex();
|
||||||
aDA1A2=aPApex1.SquareDistance(aPApex2);
|
aDA1A2 = aPApex1.SquareDistance(aPApex2);
|
||||||
//
|
//
|
||||||
AxeOperator A1A2(Con1.Axis(),Con2.Axis());
|
AxeOperator A1A2(Con1.Axis(), Con2.Axis());
|
||||||
//
|
//
|
||||||
|
Standard_Real aTolAng = myEPSILON_ANGLE_CONE;
|
||||||
|
if ((Abs(tg1 - tg2) < Tol) && (A1A2.Parallel()))
|
||||||
|
{
|
||||||
|
Standard_Real DistA1A2 = A1A2.Distance();
|
||||||
|
if (DistA1A2 > 100. * Tol)
|
||||||
|
{
|
||||||
|
Standard_Real aMinSolDist = EstimDist(Con1, Con2);
|
||||||
|
if (aMinSolDist < Epsilon(1.))
|
||||||
|
{
|
||||||
|
aTolAng = Tol;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aTolAng = Max(myEPSILON_ANGLE_CONE, Tol / aMinSolDist);
|
||||||
|
aTolAng = Min(aTolAng, Tol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 1
|
// 1
|
||||||
if(A1A2.Same()) {
|
if(A1A2.Same()) {
|
||||||
//-- two circles
|
//-- two circles
|
||||||
@@ -1427,8 +1522,8 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
|
|||||||
}
|
}
|
||||||
} //-- fin A1A2.Same
|
} //-- fin A1A2.Same
|
||||||
// 2
|
// 2
|
||||||
else if((Abs(tg1-tg2)<myEPSILON_ANGLE_CONE) && (A1A2.Parallel())) {
|
else if((Abs(tg1-tg2) < aTolAng ) && (A1A2.Parallel())) {
|
||||||
//-- voir AnVer12mai98
|
|
||||||
Standard_Real DistA1A2=A1A2.Distance();
|
Standard_Real DistA1A2=A1A2.Distance();
|
||||||
gp_Dir DA1=Con1.Position().Direction();
|
gp_Dir DA1=Con1.Position().Direction();
|
||||||
gp_Vec O1O2(Con1.Apex(),Con2.Apex());
|
gp_Vec O1O2(Con1.Apex(),Con2.Apex());
|
||||||
|
@@ -990,15 +990,19 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
|||||||
if (typl == IntPatch_Circle || typl == IntPatch_Ellipse) {////
|
if (typl == IntPatch_Circle || typl == IntPatch_Ellipse) {////
|
||||||
if(myApprox1) {
|
if(myApprox1) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
|
GeomInt_IntSS::BuildPCurves(fprm, lprm,
|
||||||
myHS1->Surface(), newc, C2d);
|
myHS1->FirstUParameter(), myHS1->LastUParameter(),
|
||||||
|
myHS1->FirstVParameter(), myHS1->LastVParameter(),
|
||||||
|
Tolpc, myHS1->Surface(), newc, C2d);
|
||||||
aCurve.SetFirstCurve2d(C2d);
|
aCurve.SetFirstCurve2d(C2d);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myApprox2) {
|
if(myApprox2) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
GeomInt_IntSS::BuildPCurves(fprm,lprm,Tolpc,
|
GeomInt_IntSS::BuildPCurves(fprm, lprm,
|
||||||
myHS2->Surface(),newc,C2d);
|
myHS2->FirstUParameter(), myHS2->LastUParameter(),
|
||||||
|
myHS2->FirstVParameter(), myHS2->LastVParameter(),
|
||||||
|
Tolpc, myHS2->Surface(), newc, C2d);
|
||||||
aCurve.SetSecondCurve2d(C2d);
|
aCurve.SetSecondCurve2d(C2d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1059,15 +1063,19 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
|||||||
|
|
||||||
if(myApprox1) {
|
if(myApprox1) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
|
GeomInt_IntSS::BuildPCurves(fprm, lprm,
|
||||||
myHS1->Surface(), newc, C2d);
|
myHS1->FirstUParameter(), myHS1->LastUParameter(),
|
||||||
|
myHS1->FirstVParameter(), myHS1->LastVParameter(),
|
||||||
|
Tolpc, myHS1->Surface(), newc, C2d);
|
||||||
aCurve.SetFirstCurve2d(C2d);
|
aCurve.SetFirstCurve2d(C2d);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myApprox2) {
|
if(myApprox2) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
|
GeomInt_IntSS::BuildPCurves(fprm, lprm,
|
||||||
myHS2->Surface(), newc, C2d);
|
myHS2->FirstUParameter(), myHS2->LastUParameter(),
|
||||||
|
myHS2->FirstVParameter(), myHS2->LastVParameter(),
|
||||||
|
Tolpc, myHS2->Surface(), newc, C2d);
|
||||||
aCurve.SetSecondCurve2d(C2d);
|
aCurve.SetSecondCurve2d(C2d);
|
||||||
}
|
}
|
||||||
}// end of if (typl == IntPatch_Circle || typl == IntPatch_Ellipse)
|
}// end of if (typl == IntPatch_Circle || typl == IntPatch_Ellipse)
|
||||||
|
@@ -33,9 +33,7 @@ namespace
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
RWGltf_ConfigurationNode::RWGltf_ConfigurationNode() :
|
RWGltf_ConfigurationNode::RWGltf_ConfigurationNode() :
|
||||||
DE_ConfigurationNode()
|
DE_ConfigurationNode()
|
||||||
{
|
{}
|
||||||
UpdateLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : RWGltf_ConfigurationNode
|
// function : RWGltf_ConfigurationNode
|
||||||
@@ -45,7 +43,6 @@ RWGltf_ConfigurationNode::RWGltf_ConfigurationNode(const Handle(RWGltf_Configura
|
|||||||
:DE_ConfigurationNode(theNode)
|
:DE_ConfigurationNode(theNode)
|
||||||
{
|
{
|
||||||
InternalParameters = theNode->InternalParameters;
|
InternalParameters = theNode->InternalParameters;
|
||||||
UpdateLoad();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -33,9 +33,7 @@ namespace
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
RWObj_ConfigurationNode::RWObj_ConfigurationNode() :
|
RWObj_ConfigurationNode::RWObj_ConfigurationNode() :
|
||||||
DE_ConfigurationNode()
|
DE_ConfigurationNode()
|
||||||
{
|
{}
|
||||||
UpdateLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : RWObj_ConfigurationNode
|
// function : RWObj_ConfigurationNode
|
||||||
@@ -45,7 +43,6 @@ RWObj_ConfigurationNode::RWObj_ConfigurationNode(const Handle(RWObj_Configuratio
|
|||||||
:DE_ConfigurationNode(theNode)
|
:DE_ConfigurationNode(theNode)
|
||||||
{
|
{
|
||||||
InternalParameters = theNode->InternalParameters;
|
InternalParameters = theNode->InternalParameters;
|
||||||
UpdateLoad();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -27,9 +27,7 @@ static const TCollection_AsciiString THE_CONFIGURATION_SCOPE = "provider";
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
RWPly_ConfigurationNode::RWPly_ConfigurationNode() :
|
RWPly_ConfigurationNode::RWPly_ConfigurationNode() :
|
||||||
DE_ConfigurationNode()
|
DE_ConfigurationNode()
|
||||||
{
|
{}
|
||||||
UpdateLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : RWPly_ConfigurationNode
|
// function : RWPly_ConfigurationNode
|
||||||
@@ -39,7 +37,6 @@ RWPly_ConfigurationNode::RWPly_ConfigurationNode(const Handle(RWPly_Configuratio
|
|||||||
:DE_ConfigurationNode(theNode)
|
:DE_ConfigurationNode(theNode)
|
||||||
{
|
{
|
||||||
InternalParameters = theNode->InternalParameters;
|
InternalParameters = theNode->InternalParameters;
|
||||||
UpdateLoad();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -106,6 +106,11 @@ void RWStepShape_RWEdgeLoop::Check
|
|||||||
Standard_Boolean headToTail = Standard_True;
|
Standard_Boolean headToTail = Standard_True;
|
||||||
//Standard_Boolean noIdentVtx = Standard_True; //szv#4:S4163:12Mar99 unused
|
//Standard_Boolean noIdentVtx = Standard_True; //szv#4:S4163:12Mar99 unused
|
||||||
Standard_Integer nbEdg = ent->NbEdgeList();
|
Standard_Integer nbEdg = ent->NbEdgeList();
|
||||||
|
if (nbEdg == 0)
|
||||||
|
{
|
||||||
|
ach->AddFail("Edge loop contains empty edge list");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Handle(StepShape_OrientedEdge) theOE = ent->EdgeListValue(1);
|
Handle(StepShape_OrientedEdge) theOE = ent->EdgeListValue(1);
|
||||||
Handle(StepShape_Vertex) theVxFrst = theOE->EdgeStart();
|
Handle(StepShape_Vertex) theVxFrst = theOE->EdgeStart();
|
||||||
Handle(StepShape_Vertex) theVxLst = theOE->EdgeEnd();
|
Handle(StepShape_Vertex) theVxLst = theOE->EdgeEnd();
|
||||||
|
@@ -34,9 +34,7 @@ namespace
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
RWStl_ConfigurationNode::RWStl_ConfigurationNode() :
|
RWStl_ConfigurationNode::RWStl_ConfigurationNode() :
|
||||||
DE_ConfigurationNode()
|
DE_ConfigurationNode()
|
||||||
{
|
{}
|
||||||
UpdateLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : STEPCAFControl_ConfigurationNode
|
// function : STEPCAFControl_ConfigurationNode
|
||||||
@@ -46,7 +44,6 @@ RWStl_ConfigurationNode::RWStl_ConfigurationNode(const Handle(RWStl_Configuratio
|
|||||||
:DE_ConfigurationNode(theNode)
|
:DE_ConfigurationNode(theNode)
|
||||||
{
|
{
|
||||||
InternalParameters = theNode->InternalParameters;
|
InternalParameters = theNode->InternalParameters;
|
||||||
UpdateLoad();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -34,9 +34,7 @@ namespace
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode() :
|
STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode() :
|
||||||
DE_ConfigurationNode()
|
DE_ConfigurationNode()
|
||||||
{
|
{}
|
||||||
UpdateLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : STEPCAFControl_ConfigurationNode
|
// function : STEPCAFControl_ConfigurationNode
|
||||||
@@ -45,9 +43,7 @@ STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode() :
|
|||||||
STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode(const Handle(STEPCAFControl_ConfigurationNode)& theNode)
|
STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode(const Handle(STEPCAFControl_ConfigurationNode)& theNode)
|
||||||
:DE_ConfigurationNode(theNode),
|
:DE_ConfigurationNode(theNode),
|
||||||
InternalParameters(theNode->InternalParameters)
|
InternalParameters(theNode->InternalParameters)
|
||||||
{
|
{}
|
||||||
UpdateLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : Load
|
// function : Load
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,7 @@
|
|||||||
#include <StepVisual_DraughtingModel.hxx>
|
#include <StepVisual_DraughtingModel.hxx>
|
||||||
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
|
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
|
||||||
#include <TDF_LabelSequence.hxx>
|
#include <TDF_LabelSequence.hxx>
|
||||||
|
#include <TDF_LabelMap.hxx>
|
||||||
#include <XCAFDimTolObjects_GeomToleranceObject.hxx>
|
#include <XCAFDimTolObjects_GeomToleranceObject.hxx>
|
||||||
|
|
||||||
class XSControl_WorkSession;
|
class XSControl_WorkSession;
|
||||||
@@ -44,219 +45,234 @@ class TopoDS_Shape;
|
|||||||
//! colors and part names
|
//! colors and part names
|
||||||
//!
|
//!
|
||||||
//! Also supports multifile writing
|
//! Also supports multifile writing
|
||||||
class STEPCAFControl_Writer
|
class STEPCAFControl_Writer
|
||||||
{
|
{
|
||||||
|
DEFINE_STANDARD_ALLOC
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DEFINE_STANDARD_ALLOC
|
|
||||||
|
|
||||||
|
|
||||||
//! Creates a writer with an empty
|
//! Creates a writer with an empty
|
||||||
//! STEP model and sets ColorMode, LayerMode, NameMode and
|
//! STEP model and sets ColorMode, LayerMode, NameMode and
|
||||||
//! PropsMode to Standard_True.
|
//! PropsMode to Standard_True.
|
||||||
Standard_EXPORT STEPCAFControl_Writer();
|
Standard_EXPORT STEPCAFControl_Writer();
|
||||||
|
|
||||||
//! Creates a reader tool and attaches it to an already existing Session
|
//! Creates a reader tool and attaches it to an already existing Session
|
||||||
//! Clears the session if it was not yet set for STEP
|
//! Clears the session if it was not yet set for STEP
|
||||||
//! Clears the internal data structures
|
//! Clears the internal data structures
|
||||||
Standard_EXPORT STEPCAFControl_Writer(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
|
Standard_EXPORT STEPCAFControl_Writer(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const Standard_Boolean theScratch = Standard_True);
|
||||||
|
|
||||||
//! Clears the internal data structures and attaches to a new session
|
//! Clears the internal data structures and attaches to a new session
|
||||||
//! Clears the session if it was not yet set for STEP
|
//! Clears the session if it was not yet set for STEP
|
||||||
Standard_EXPORT void Init (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
|
Standard_EXPORT void Init(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const Standard_Boolean theScratch = Standard_True);
|
||||||
|
|
||||||
//! Writes all the produced models into file
|
//! Writes all the produced models into file
|
||||||
//! In case of multimodel with extern references,
|
//! In case of multimodel with extern references,
|
||||||
//! filename will be a name of root file, all other files
|
//! filename will be a name of root file, all other files
|
||||||
//! have names of corresponding parts
|
//! have names of corresponding parts
|
||||||
//! Provided for use like single-file writer
|
//! Provided for use like single-file writer
|
||||||
Standard_EXPORT IFSelect_ReturnStatus Write (const Standard_CString theFileName);
|
Standard_EXPORT IFSelect_ReturnStatus Write(const Standard_CString theFileName);
|
||||||
|
|
||||||
//! Writes all the produced models into the stream.
|
//! Writes all the produced models into the stream.
|
||||||
//! Provided for use like single-file writer
|
//! Provided for use like single-file writer
|
||||||
Standard_EXPORT IFSelect_ReturnStatus WriteStream (std::ostream& theStream);
|
Standard_EXPORT IFSelect_ReturnStatus WriteStream(std::ostream& theStream);
|
||||||
|
|
||||||
//! Transfers a document (or single label) to a STEP model
|
//! Transfers a document (or single label) to a STEP model
|
||||||
//! The mode of translation of shape is AsIs
|
//! The mode of translation of shape is AsIs
|
||||||
//! If multi is not null pointer, it switches to multifile
|
//! If multi is not null pointer, it switches to multifile
|
||||||
//! mode (with external refs), and string pointed by <multi>
|
//! mode (with external refs), and string pointed by <multi>
|
||||||
//! gives prefix for names of extern files (can be empty string)
|
//! gives prefix for names of extern files (can be empty string)
|
||||||
//! Returns True if translation is OK
|
//! Returns True if translation is OK
|
||||||
Standard_EXPORT Standard_Boolean Transfer (const Handle(TDocStd_Document)& doc,
|
Standard_EXPORT Standard_Boolean Transfer(const Handle(TDocStd_Document)& theDoc,
|
||||||
const STEPControl_StepModelType mode = STEPControl_AsIs,
|
const STEPControl_StepModelType theMode = STEPControl_AsIs,
|
||||||
const Standard_CString multi = 0,
|
const Standard_CString theIsMulti = 0,
|
||||||
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Method to transfer part of the document specified by label
|
//! Method to transfer part of the document specified by label
|
||||||
Standard_EXPORT Standard_Boolean Transfer (const TDF_Label& L,
|
Standard_EXPORT Standard_Boolean Transfer(const TDF_Label& theLabel,
|
||||||
const STEPControl_StepModelType mode = STEPControl_AsIs,
|
const STEPControl_StepModelType theMode = STEPControl_AsIs,
|
||||||
const Standard_CString multi = 0,
|
const Standard_CString theIsMulti = 0,
|
||||||
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Mehod to writing sequence of root assemblies or part of the file specified by use by one label
|
//! Mehod to writing sequence of root assemblies or part of the file specified by use by one label
|
||||||
Standard_EXPORT Standard_Boolean Transfer (const TDF_LabelSequence& L,
|
Standard_EXPORT Standard_Boolean Transfer(const TDF_LabelSequence& theLabelSeq,
|
||||||
const STEPControl_StepModelType mode = STEPControl_AsIs,
|
const STEPControl_StepModelType theMode = STEPControl_AsIs,
|
||||||
const Standard_CString multi = 0,
|
const Standard_CString theIsMulti = 0,
|
||||||
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean Perform (const Handle(TDocStd_Document)& doc,
|
|
||||||
const TCollection_AsciiString& filename,
|
|
||||||
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Boolean Perform(const Handle(TDocStd_Document)& theDoc,
|
||||||
|
const TCollection_AsciiString& theFileName,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Transfers a document and writes it to a STEP file
|
//! Transfers a document and writes it to a STEP file
|
||||||
//! Returns True if translation is OK
|
//! Returns True if translation is OK
|
||||||
Standard_EXPORT Standard_Boolean Perform (const Handle(TDocStd_Document)& doc,
|
Standard_EXPORT Standard_Boolean Perform(const Handle(TDocStd_Document)& theDoc,
|
||||||
const Standard_CString filename,
|
const Standard_CString theFileName,
|
||||||
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Returns data on external files
|
//! Returns data on external files
|
||||||
//! Returns Null handle if no external files are read
|
//! Returns Null handle if no external files are read
|
||||||
Standard_EXPORT const NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>& ExternFiles() const;
|
const NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>& ExternFiles() const { return myFiles; };
|
||||||
|
|
||||||
//! Returns data on external file by its original label
|
//! Returns data on external file by its original label
|
||||||
//! Returns False if no external file with given name is read
|
//! Returns False if no external file with given name is read
|
||||||
Standard_EXPORT Standard_Boolean ExternFile (const TDF_Label& L, Handle(STEPCAFControl_ExternFile)& ef) const;
|
Standard_EXPORT Standard_Boolean ExternFile(const TDF_Label& theLabel,
|
||||||
|
Handle(STEPCAFControl_ExternFile)& theExtFile) const;
|
||||||
|
|
||||||
//! Returns data on external file by its name
|
//! Returns data on external file by its name
|
||||||
//! Returns False if no external file with given name is read
|
//! Returns False if no external file with given name is read
|
||||||
Standard_EXPORT Standard_Boolean ExternFile (const Standard_CString name, Handle(STEPCAFControl_ExternFile)& ef) const;
|
Standard_EXPORT Standard_Boolean ExternFile(const Standard_CString theName,
|
||||||
|
Handle(STEPCAFControl_ExternFile)& theExtFile) const;
|
||||||
|
|
||||||
//! Returns basic reader for root file
|
//! Returns basic reader for root file
|
||||||
Standard_EXPORT STEPControl_Writer& ChangeWriter();
|
STEPControl_Writer& ChangeWriter() { return myWriter; }
|
||||||
|
|
||||||
//! Returns basic reader as const
|
//! Returns basic reader as const
|
||||||
Standard_EXPORT const STEPControl_Writer& Writer() const;
|
const STEPControl_Writer& Writer() const { return myWriter; }
|
||||||
|
|
||||||
//! Set ColorMode for indicate write Colors or not.
|
//! Set ColorMode for indicate write Colors or not.
|
||||||
Standard_EXPORT void SetColorMode (const Standard_Boolean colormode);
|
void SetColorMode(const Standard_Boolean theColorMode) { myColorMode = theColorMode; }
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean GetColorMode() const;
|
Standard_Boolean GetColorMode() const { return myColorMode; }
|
||||||
|
|
||||||
//! Set NameMode for indicate write Name or not.
|
//! Set NameMode for indicate write Name or not.
|
||||||
Standard_EXPORT void SetNameMode (const Standard_Boolean namemode);
|
void SetNameMode(const Standard_Boolean theNameMode) { myNameMode = theNameMode; }
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean GetNameMode() const;
|
Standard_Boolean GetNameMode() const { return myNameMode; }
|
||||||
|
|
||||||
//! Set LayerMode for indicate write Layers or not.
|
//! Set LayerMode for indicate write Layers or not.
|
||||||
Standard_EXPORT void SetLayerMode (const Standard_Boolean layermode);
|
void SetLayerMode(const Standard_Boolean theLayerMode) { myLayerMode = theLayerMode; }
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean GetLayerMode() const;
|
Standard_Boolean GetLayerMode() const { return myLayerMode; }
|
||||||
|
|
||||||
//! PropsMode for indicate write Validation properties or not.
|
//! PropsMode for indicate write Validation properties or not.
|
||||||
Standard_EXPORT void SetPropsMode (const Standard_Boolean propsmode);
|
void SetPropsMode(const Standard_Boolean thePropsMode) { myPropsMode = thePropsMode; }
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean GetPropsMode() const;
|
Standard_Boolean GetPropsMode() const { return myPropsMode; }
|
||||||
|
|
||||||
//! Set SHUO mode for indicate write SHUO or not.
|
//! Set SHUO mode for indicate write SHUO or not.
|
||||||
Standard_EXPORT void SetSHUOMode (const Standard_Boolean shuomode);
|
void SetSHUOMode(const Standard_Boolean theSHUOMode) { mySHUOMode = theSHUOMode; }
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean GetSHUOMode() const;
|
Standard_Boolean GetSHUOMode() const { return mySHUOMode; }
|
||||||
|
|
||||||
//! Set dimtolmode for indicate write D>s or not.
|
//! Set dimtolmode for indicate write D>s or not.
|
||||||
Standard_EXPORT void SetDimTolMode (const Standard_Boolean dimtolmode);
|
void SetDimTolMode(const Standard_Boolean theDimTolMode) { myGDTMode = theDimTolMode; };
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean GetDimTolMode() const;
|
Standard_Boolean GetDimTolMode() const { return myGDTMode; }
|
||||||
|
|
||||||
//! Set dimtolmode for indicate write D>s or not.
|
//! Set dimtolmode for indicate write D>s or not.
|
||||||
Standard_EXPORT void SetMaterialMode (const Standard_Boolean matmode);
|
void SetMaterialMode(const Standard_Boolean theMaterialMode) { myMatMode = theMaterialMode; }
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean GetMaterialMode() const;
|
Standard_Boolean GetMaterialMode() const { return myMatMode; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//! Transfers labels to a STEP model
|
//! Transfers labels to a STEP model
|
||||||
//! Returns True if translation is OK
|
//! Returns True if translation is OK
|
||||||
//! isExternFile setting from TransferExternFiles method
|
//! isExternFile setting from transferExternFiles method
|
||||||
Standard_EXPORT Standard_Boolean Transfer (STEPControl_Writer& wr,
|
Standard_Boolean transfer(STEPControl_Writer& theWriter,
|
||||||
const TDF_LabelSequence& labels,
|
const TDF_LabelSequence& theLabels,
|
||||||
const STEPControl_StepModelType mode = STEPControl_AsIs,
|
const STEPControl_StepModelType theMode = STEPControl_AsIs,
|
||||||
const Standard_CString multi = 0,
|
const Standard_CString theIsMulti = 0,
|
||||||
const Standard_Boolean isExternFile = Standard_False,
|
const Standard_Boolean isExternFile = Standard_False,
|
||||||
const Message_ProgressRange& theProgress = Message_ProgressRange()) ;
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Parses assembly structure of label L, writes all the simple
|
//! Parses assembly structure of label L, writes all the simple
|
||||||
//! shapes each to its own file named by name of its label plus
|
//! shapes each to its own file named by name of its label plus
|
||||||
//! prefix
|
//! prefix
|
||||||
//! Returns shape representing that assembly structure
|
//! Returns shape representing that assembly structure
|
||||||
//! in the form of nested empty compounds (and a sequence of
|
//! in the form of nested empty compounds (and a sequence of
|
||||||
//! labels which are newly written nodes of this assembly)
|
//! labels which are newly written nodes of this assembly)
|
||||||
Standard_EXPORT TopoDS_Shape TransferExternFiles (const TDF_Label& L,
|
TopoDS_Shape transferExternFiles(const TDF_Label& theLabel,
|
||||||
const STEPControl_StepModelType mode,
|
const STEPControl_StepModelType theMode,
|
||||||
TDF_LabelSequence& Lseq,
|
TDF_LabelSequence& theLabelSeq,
|
||||||
const Standard_CString prefix = "",
|
const Standard_CString thePrefix = "",
|
||||||
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Write external references to STEP
|
//! Write external references to STEP
|
||||||
Standard_EXPORT Standard_Boolean WriteExternRefs (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels) const;
|
Standard_Boolean writeExternRefs(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theLabels) const;
|
||||||
|
|
||||||
//! Write colors assigned to specified labels, to STEP model
|
//! Write colors assigned to specified labels, to STEP model
|
||||||
Standard_EXPORT Standard_Boolean WriteColors (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels);
|
Standard_Boolean writeColors(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theLabels);
|
||||||
|
|
||||||
//! Write names assigned to specified labels, to STEP model
|
//! Write names assigned to specified labels, to STEP model
|
||||||
Standard_EXPORT Standard_Boolean WriteNames (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels) const;
|
Standard_Boolean writeNames(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theLabels) const;
|
||||||
|
|
||||||
//! Write D>s assigned to specified labels, to STEP model
|
//! Write D>s assigned to specified labels, to STEP model
|
||||||
Standard_EXPORT Standard_Boolean WriteDGTs (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels) const;
|
Standard_Boolean writeDGTs(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theLabels) const;
|
||||||
//! Write D>s assigned to specified labels, to STEP model, according AP242
|
|
||||||
Standard_EXPORT Standard_Boolean WriteDGTsAP242 (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels);
|
//! Write D>s assigned to specified labels, to STEP model, according AP242
|
||||||
|
Standard_Boolean writeDGTsAP242(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theLabels);
|
||||||
|
|
||||||
//! Write materials assigned to specified labels, to STEP model
|
//! Write materials assigned to specified labels, to STEP model
|
||||||
Standard_EXPORT Standard_Boolean WriteMaterials (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels) const;
|
Standard_Boolean writeMaterials(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theLabels) const;
|
||||||
|
|
||||||
//! Write validation properties assigned to specified labels,
|
//! Write validation properties assigned to specified labels,
|
||||||
//! to STEP model
|
//! to STEP model
|
||||||
Standard_EXPORT Standard_Boolean WriteValProps (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels, const Standard_CString multi) const;
|
Standard_Boolean writeValProps(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theLabels,
|
||||||
|
const Standard_CString theIsMulti) const;
|
||||||
|
|
||||||
//! Write layers assigned to specified labels, to STEP model
|
//! Write layers assigned to specified labels, to STEP model
|
||||||
Standard_EXPORT Standard_Boolean WriteLayers (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels) const;
|
Standard_Boolean writeLayers(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theLabels) const;
|
||||||
|
|
||||||
//! Write SHUO assigned to specified component, to STEP model
|
//! Write SHUO assigned to specified component, to STEP model
|
||||||
Standard_EXPORT Standard_Boolean WriteSHUOs (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels);
|
Standard_Boolean writeSHUOs(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theLabels);
|
||||||
|
|
||||||
//! Finds length units located in root of label
|
//! Finds length units located in root of label
|
||||||
//! If it exists, initializes local length unit from it
|
//! If it exists, initializes local length unit from it
|
||||||
//! Else initializes according to Cascade length unit
|
//! Else initializes according to Cascade length unit
|
||||||
Standard_EXPORT void prepareUnit(const TDF_Label& theLabel,
|
void prepareUnit(const TDF_Label& theLabel,
|
||||||
const Handle(StepData_StepModel)& theModel);
|
const Handle(StepData_StepModel)& theModel);
|
||||||
|
|
||||||
|
Handle(StepRepr_ShapeAspect) writeShapeAspect(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_Label theLabel,
|
||||||
|
const TopoDS_Shape theShape,
|
||||||
|
Handle(StepRepr_RepresentationContext)& theRC,
|
||||||
|
Handle(StepAP242_GeometricItemSpecificUsage)& theGISU);
|
||||||
|
|
||||||
|
void writePresentation(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TopoDS_Shape& thePresentation,
|
||||||
|
const Handle(TCollection_HAsciiString)& thePrsName,
|
||||||
|
const Standard_Boolean theHasSemantic,
|
||||||
|
const Standard_Boolean theHasPlane,
|
||||||
|
const gp_Ax2& theAnnotationPlane,
|
||||||
|
const gp_Pnt& theTextPosition,
|
||||||
|
const Handle(Standard_Transient) theDimension);
|
||||||
|
|
||||||
|
Handle(StepDimTol_Datum) writeDatumAP242(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theShapeL,
|
||||||
|
const TDF_Label& theDatumL,
|
||||||
|
const Standard_Boolean isFirstDTarget,
|
||||||
|
const Handle(StepDimTol_Datum) theWrittenDatum);
|
||||||
|
|
||||||
|
void writeToleranceZone(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObject,
|
||||||
|
const Handle(StepDimTol_GeometricTolerance)& theEntity,
|
||||||
|
const Handle(StepRepr_RepresentationContext)& theRC);
|
||||||
|
|
||||||
|
void writeGeomTolerance(const Handle(XSControl_WorkSession)& theWS,
|
||||||
|
const TDF_LabelSequence& theShapeSeqL,
|
||||||
|
const TDF_Label& theGeomTolL,
|
||||||
|
const Handle(StepDimTol_HArray1OfDatumSystemOrReference)& theDatumSystem,
|
||||||
|
const Handle(StepRepr_RepresentationContext)& theRC);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Standard_EXPORT Handle(StepRepr_ShapeAspect) WriteShapeAspect(const Handle(XSControl_WorkSession) &WS,
|
|
||||||
const TDF_Label theLabel, const TopoDS_Shape theShape, Handle(StepRepr_RepresentationContext)& theRC,
|
|
||||||
Handle(StepAP242_GeometricItemSpecificUsage)& theGISU);
|
|
||||||
|
|
||||||
Standard_EXPORT void WritePresentation(const Handle(XSControl_WorkSession)& WS,
|
|
||||||
const TopoDS_Shape& thePresentation,
|
|
||||||
const Handle(TCollection_HAsciiString)& thePrsName,
|
|
||||||
const Standard_Boolean hasSemantic,
|
|
||||||
const Standard_Boolean hasPlane,
|
|
||||||
const gp_Ax2& theAnnotationPlane,
|
|
||||||
const gp_Pnt& theTextPosition,
|
|
||||||
const Handle(Standard_Transient) theDimension);
|
|
||||||
|
|
||||||
Standard_EXPORT Handle(StepDimTol_Datum) WriteDatumAP242(const Handle(XSControl_WorkSession)& WS,
|
|
||||||
const TDF_LabelSequence& theShapeL,
|
|
||||||
const TDF_Label& theDatumL,
|
|
||||||
const Standard_Boolean isFirstDTarget,
|
|
||||||
const Handle(StepDimTol_Datum) theWrittenDatum);
|
|
||||||
|
|
||||||
Standard_EXPORT void WriteToleranceZone(const Handle(XSControl_WorkSession) &WS, const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObject,
|
|
||||||
const Handle(StepDimTol_GeometricTolerance)& theEntity, const Handle(StepRepr_RepresentationContext)& theRC);
|
|
||||||
|
|
||||||
Standard_EXPORT void WriteGeomTolerance(const Handle(XSControl_WorkSession)& WS,
|
|
||||||
const TDF_LabelSequence& theShapeSeqL,
|
|
||||||
const TDF_Label& theGeomTolL,
|
|
||||||
const Handle(StepDimTol_HArray1OfDatumSystemOrReference)& theDatumSystem,
|
|
||||||
const Handle(StepRepr_RepresentationContext)& theRC);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
STEPControl_Writer myWriter;
|
STEPControl_Writer myWriter;
|
||||||
NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)> myFiles;
|
NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)> myFiles;
|
||||||
|
TDF_LabelMap myRootLabels;
|
||||||
STEPCAFControl_DataMapOfLabelShape myLabels;
|
STEPCAFControl_DataMapOfLabelShape myLabels;
|
||||||
STEPCAFControl_DataMapOfLabelExternFile myLabEF;
|
STEPCAFControl_DataMapOfLabelExternFile myLabEF;
|
||||||
|
STEPCAFControl_DataMapOfLabelShape myPureRefLabels;
|
||||||
Standard_Boolean myColorMode;
|
Standard_Boolean myColorMode;
|
||||||
Standard_Boolean myNameMode;
|
Standard_Boolean myNameMode;
|
||||||
Standard_Boolean myLayerMode;
|
Standard_Boolean myLayerMode;
|
||||||
@@ -272,7 +288,4 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _STEPCAFControl_Writer_HeaderFile
|
#endif // _STEPCAFControl_Writer_HeaderFile
|
||||||
|
@@ -869,32 +869,27 @@ Standard_Boolean SelectMgr_Frustum<N>::hasCircleOverlap (const Standard_Real the
|
|||||||
const gp_Pnt aCenterProject (aCoefA * aTCenter,
|
const gp_Pnt aCenterProject (aCoefA * aTCenter,
|
||||||
aCoefB * aTCenter,
|
aCoefB * aTCenter,
|
||||||
aCoefC * aTCenter);
|
aCoefC * aTCenter);
|
||||||
if (isDotInside (aCenterProject, aVertices))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Boolean isInside = true;
|
const Standard_Boolean isCenterInside = isDotInside (aCenterProject, aVertices);
|
||||||
|
|
||||||
|
Standard_Boolean isInside = false;
|
||||||
for (Standard_Integer anIdx = aVertices.Lower(); anIdx <= aVertices.Upper(); anIdx++)
|
for (Standard_Integer anIdx = aVertices.Lower(); anIdx <= aVertices.Upper(); anIdx++)
|
||||||
{
|
{
|
||||||
if (aVertices.Value (anIdx).Distance (aCenterProject) > theRadius)
|
if (aVertices.Value (anIdx).Distance (aCenterProject) > theRadius)
|
||||||
{
|
{
|
||||||
isInside = false;
|
isInside = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theInside != NULL)
|
if (theInside != NULL)
|
||||||
{
|
{
|
||||||
*theInside = false;
|
*theInside = isInside && isCenterInside;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!theIsFilled && isInside)
|
return theIsFilled
|
||||||
{
|
? !isInside || (isCenterInside && isInside)
|
||||||
return false;
|
: isInside && isCenterInside;
|
||||||
}
|
|
||||||
|
|
||||||
return isInside;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -58,12 +58,33 @@ public:
|
|||||||
return ZLayerPosition > theOther.ZLayerPosition;
|
return ZLayerPosition > theOther.ZLayerPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
// closest object is selected unless difference is within tolerance
|
// closest object is selected if their depths are not equal within tolerance
|
||||||
if (Abs (Depth - theOther.Depth) > (Tolerance + theOther.Tolerance))
|
if (Abs (Depth - theOther.Depth) > Tolerance + theOther.Tolerance)
|
||||||
{
|
{
|
||||||
return Depth < theOther.Depth;
|
return Depth < theOther.Depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Standard_Real aCos = 1.0;
|
||||||
|
if (Normal.Modulus() > 0 && theOther.Normal.Modulus() > 0)
|
||||||
|
{
|
||||||
|
gp_Dir aNormal (Normal.x(), Normal.y(), Normal.z());
|
||||||
|
gp_Dir anOtherNormal (theOther.Normal.x(), theOther.Normal.y(), theOther.Normal.z());
|
||||||
|
aCos = Abs (Cos (aNormal.Angle (anOtherNormal)));
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Real aDepth = Depth - Tolerance;
|
||||||
|
Standard_Real anOtherDepth = theOther.Depth - theOther.Tolerance;
|
||||||
|
// Comparison depths taking into account tolerances occurs when the surfaces are parallel
|
||||||
|
// or have the same sensitivity and the angle between them is less than 60 degrees.
|
||||||
|
if (Abs (aDepth - anOtherDepth) > Precision::Confusion())
|
||||||
|
{
|
||||||
|
if ((aCos > 0.5 && Abs (Tolerance - theOther.Tolerance) < Precision::Confusion())
|
||||||
|
|| Abs (aCos - 1.0) < Precision::Confusion())
|
||||||
|
{
|
||||||
|
return aDepth < anOtherDepth;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if two objects have similar depth, select the one with higher priority
|
// if two objects have similar depth, select the one with higher priority
|
||||||
if (Priority > theOther.Priority)
|
if (Priority > theOther.Priority)
|
||||||
{
|
{
|
||||||
|
@@ -284,9 +284,9 @@ void SelectMgr_ViewerSelector::checkOverlap (const Handle(Select3D_SensitiveEnti
|
|||||||
aCriterion.NbOwnerMatches = aPrevCriterion->NbOwnerMatches;
|
aCriterion.NbOwnerMatches = aPrevCriterion->NbOwnerMatches;
|
||||||
if (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Box)
|
if (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Box)
|
||||||
{
|
{
|
||||||
|
updatePoint3d (aCriterion, aPickResult, theEntity, theInversedTrsf, theMgr);
|
||||||
if (aCriterion.IsCloserDepth (*aPrevCriterion))
|
if (aCriterion.IsCloserDepth (*aPrevCriterion))
|
||||||
{
|
{
|
||||||
updatePoint3d (aCriterion, aPickResult, theEntity, theInversedTrsf, theMgr);
|
|
||||||
*aPrevCriterion = aCriterion;
|
*aPrevCriterion = aCriterion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -138,7 +138,7 @@ void StepToTopoDS_TranslateShell::Init(const Handle(StepVisual_TessellatedShell)
|
|||||||
{
|
{
|
||||||
Handle(TransferBRep_ShapeBinder) aBinder
|
Handle(TransferBRep_ShapeBinder) aBinder
|
||||||
= Handle(TransferBRep_ShapeBinder)::DownCast(aTP->Find(theTSh->TopologicalLink()));
|
= Handle(TransferBRep_ShapeBinder)::DownCast(aTP->Find(theTSh->TopologicalLink()));
|
||||||
if (aBinder.IsNull())
|
if (!aBinder.IsNull())
|
||||||
{
|
{
|
||||||
aSh = aBinder->Shell();
|
aSh = aBinder->Shell();
|
||||||
theHasGeom = Standard_True;
|
theHasGeom = Standard_True;
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <ViewerTest.hxx>
|
#include <ViewerTest.hxx>
|
||||||
|
|
||||||
|
#include <AIS_AnimationAxisRotation.hxx>
|
||||||
#include <AIS_AnimationCamera.hxx>
|
#include <AIS_AnimationCamera.hxx>
|
||||||
#include <AIS_AnimationObject.hxx>
|
#include <AIS_AnimationObject.hxx>
|
||||||
#include <AIS_Axis.hxx>
|
#include <AIS_Axis.hxx>
|
||||||
@@ -7596,6 +7597,11 @@ static Standard_Integer VAnimation (Draw_Interpretor& theDI,
|
|||||||
gp_XYZ aLocPnts [2] = { aTrsfs[0].TranslationPart(), aTrsfs[1].TranslationPart() };
|
gp_XYZ aLocPnts [2] = { aTrsfs[0].TranslationPart(), aTrsfs[1].TranslationPart() };
|
||||||
Standard_Real aScales [2] = { aTrsfs[0].ScaleFactor(), aTrsfs[1].ScaleFactor() };
|
Standard_Real aScales [2] = { aTrsfs[0].ScaleFactor(), aTrsfs[1].ScaleFactor() };
|
||||||
Standard_Boolean isTrsfSet = Standard_False;
|
Standard_Boolean isTrsfSet = Standard_False;
|
||||||
|
|
||||||
|
gp_Ax1 anAxis;
|
||||||
|
Standard_Real anAngles[2] = { 0.0, 0.0 };
|
||||||
|
Standard_Boolean isAxisRotationSet = Standard_False;
|
||||||
|
|
||||||
Standard_Integer aTrsfArgIter = anArgIter + 1;
|
Standard_Integer aTrsfArgIter = anArgIter + 1;
|
||||||
for (; aTrsfArgIter < theArgNb; ++aTrsfArgIter)
|
for (; aTrsfArgIter < theArgNb; ++aTrsfArgIter)
|
||||||
{
|
{
|
||||||
@@ -7643,13 +7649,45 @@ static Standard_Integer VAnimation (Draw_Interpretor& theDI,
|
|||||||
}
|
}
|
||||||
aScales[anIndex] = aScaleStr.RealValue();
|
aScales[anIndex] = aScaleStr.RealValue();
|
||||||
}
|
}
|
||||||
|
else if (aTrsfArg == "-axis")
|
||||||
|
{
|
||||||
|
isAxisRotationSet = Standard_True;
|
||||||
|
gp_XYZ anOrigin, aDirection;
|
||||||
|
if (aTrsfArgIter + 6 >= theArgNb
|
||||||
|
|| !parseXYZ (theArgVec + aTrsfArgIter + 1, anOrigin)
|
||||||
|
|| !parseXYZ (theArgVec + aTrsfArgIter + 4, aDirection))
|
||||||
|
{
|
||||||
|
Message::SendFail() << "Syntax error at " << aTrsfArg;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
anAxis.SetLocation (anOrigin);
|
||||||
|
anAxis.SetDirection (aDirection);
|
||||||
|
aTrsfArgIter += 6;
|
||||||
|
}
|
||||||
|
else if (aTrsfArg.StartsWith ("-ang"))
|
||||||
|
{
|
||||||
|
isAxisRotationSet = Standard_True;
|
||||||
|
if (++aTrsfArgIter >= theArgNb)
|
||||||
|
{
|
||||||
|
Message::SendFail() << "Syntax error at " << aTrsfArg;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const TCollection_AsciiString anAngleStr (theArgVec[aTrsfArgIter]);
|
||||||
|
if (!anAngleStr.IsRealValue (Standard_True))
|
||||||
|
{
|
||||||
|
Message::SendFail() << "Syntax error at " << aTrsfArg;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
anAngles[anIndex] = anAngleStr.RealValue();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
anArgIter = aTrsfArgIter - 1;
|
anArgIter = aTrsfArgIter - 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isTrsfSet)
|
if (!isTrsfSet && !isAxisRotationSet)
|
||||||
{
|
{
|
||||||
Message::SendFail() << "Syntax error at " << anArg;
|
Message::SendFail() << "Syntax error at " << anArg;
|
||||||
return 1;
|
return 1;
|
||||||
@@ -7658,15 +7696,23 @@ static Standard_Integer VAnimation (Draw_Interpretor& theDI,
|
|||||||
{
|
{
|
||||||
anArgIter = theArgNb;
|
anArgIter = theArgNb;
|
||||||
}
|
}
|
||||||
|
Handle(AIS_BaseAnimationObject) anObjAnimation;
|
||||||
|
if (isTrsfSet)
|
||||||
|
{
|
||||||
|
aTrsfs[0].SetRotation (aRotQuats[0]);
|
||||||
|
aTrsfs[1].SetRotation (aRotQuats[1]);
|
||||||
|
aTrsfs[0].SetTranslationPart (aLocPnts[0]);
|
||||||
|
aTrsfs[1].SetTranslationPart (aLocPnts[1]);
|
||||||
|
aTrsfs[0].SetScaleFactor (aScales[0]);
|
||||||
|
aTrsfs[1].SetScaleFactor (aScales[1]);
|
||||||
|
|
||||||
aTrsfs[0].SetRotation (aRotQuats[0]);
|
anObjAnimation = new AIS_AnimationObject (anAnimation->Name(), aCtx, anObject, aTrsfs[0], aTrsfs[1]);
|
||||||
aTrsfs[1].SetRotation (aRotQuats[1]);
|
}
|
||||||
aTrsfs[0].SetTranslationPart (aLocPnts[0]);
|
else
|
||||||
aTrsfs[1].SetTranslationPart (aLocPnts[1]);
|
{
|
||||||
aTrsfs[0].SetScaleFactor (aScales[0]);
|
anObjAnimation = new AIS_AnimationAxisRotation (anAnimation->Name(), aCtx, anObject, anAxis,
|
||||||
aTrsfs[1].SetScaleFactor (aScales[1]);
|
anAngles[0] * (M_PI / 180.0), anAngles[1] * (M_PI / 180.0));
|
||||||
|
}
|
||||||
Handle(AIS_AnimationObject) anObjAnimation = new AIS_AnimationObject (anAnimation->Name(), aCtx, anObject, aTrsfs[0], aTrsfs[1]);
|
|
||||||
replaceAnimation (aParentAnimation, anAnimation, anObjAnimation);
|
replaceAnimation (aParentAnimation, anAnimation, anObjAnimation);
|
||||||
}
|
}
|
||||||
else if (anArg == "-viewtrsf"
|
else if (anArg == "-viewtrsf"
|
||||||
@@ -14394,6 +14440,11 @@ Object animation:
|
|||||||
-rotX object Orientations pair (quaternions)
|
-rotX object Orientations pair (quaternions)
|
||||||
-scaleX object Scale factors pair (quaternions)
|
-scaleX object Scale factors pair (quaternions)
|
||||||
|
|
||||||
|
vanim name -object [-axis OX OY OZ DX DY DZ] [-ang1 A] [-ang2 A]
|
||||||
|
-axis rotation axis
|
||||||
|
-ang1 start rotation angle in degrees
|
||||||
|
-ang2 end rotation angle in degrees
|
||||||
|
|
||||||
Custom callback:
|
Custom callback:
|
||||||
vanim name -invoke "Command Arg1 Arg2 %Pts %LocalPts %Normalized ArgN"
|
vanim name -invoke "Command Arg1 Arg2 %Pts %LocalPts %Normalized ArgN"
|
||||||
|
|
||||||
|
@@ -33,9 +33,7 @@ namespace
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
Vrml_ConfigurationNode::Vrml_ConfigurationNode() :
|
Vrml_ConfigurationNode::Vrml_ConfigurationNode() :
|
||||||
DE_ConfigurationNode()
|
DE_ConfigurationNode()
|
||||||
{
|
{}
|
||||||
UpdateLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : STEPCAFControl_ConfigurationNode
|
// function : STEPCAFControl_ConfigurationNode
|
||||||
@@ -45,7 +43,6 @@ Vrml_ConfigurationNode::Vrml_ConfigurationNode(const Handle(Vrml_ConfigurationNo
|
|||||||
:DE_ConfigurationNode(theNode)
|
:DE_ConfigurationNode(theNode)
|
||||||
{
|
{
|
||||||
InternalParameters = theNode->InternalParameters;
|
InternalParameters = theNode->InternalParameters;
|
||||||
UpdateLoad();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -194,29 +194,63 @@ const Handle(VrmlData_WorldInfo)& VrmlData_Scene::WorldInfo() const
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
VrmlData_ErrorStatus VrmlData_Scene::readLine (VrmlData_InBuffer& theBuffer)
|
VrmlData_ErrorStatus VrmlData_Scene::readLine(VrmlData_InBuffer& theBuffer)
|
||||||
{
|
{
|
||||||
VrmlData_ErrorStatus aStatus = VrmlData_StatusOK;
|
VrmlData_ErrorStatus aStatus = VrmlData_StatusOK;
|
||||||
if (theBuffer.Input.eof())
|
if (theBuffer.Input.eof())
|
||||||
aStatus = VrmlData_EndOfFile;
|
{
|
||||||
else {
|
return VrmlData_EndOfFile;
|
||||||
theBuffer.Input.getline (theBuffer.Line, sizeof(theBuffer.Line));
|
|
||||||
theBuffer.LineCount++;
|
|
||||||
const int stat = theBuffer.Input.rdstate();
|
|
||||||
if (stat & std::ios::badbit) {
|
|
||||||
aStatus = VrmlData_UnrecoverableError;
|
|
||||||
}
|
|
||||||
else if (stat & std::ios::failbit) {
|
|
||||||
if (stat & std::ios::eofbit) {
|
|
||||||
aStatus = VrmlData_EndOfFile;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
aStatus = VrmlData_GeneralError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
theBuffer.LinePtr = &theBuffer.Line[0];
|
|
||||||
theBuffer.IsProcessed = Standard_False;
|
|
||||||
}
|
}
|
||||||
|
// Read a line.
|
||||||
|
theBuffer.Input.getline(theBuffer.Line, sizeof(theBuffer.Line));
|
||||||
|
|
||||||
|
// Check the number of read symbols.
|
||||||
|
// If maximum number is read, process the array of symbols separately
|
||||||
|
// rolling back the array to the last comma or space symbol.
|
||||||
|
std::streamsize aNbChars = theBuffer.Input.gcount();
|
||||||
|
if (theBuffer.Input.rdstate() & std::ios::failbit &&
|
||||||
|
aNbChars == sizeof(theBuffer.Line) - 1)
|
||||||
|
{
|
||||||
|
// Clear the error.
|
||||||
|
// We will fix it here below.
|
||||||
|
theBuffer.Input.clear();
|
||||||
|
size_t anInd = aNbChars - 1;
|
||||||
|
for (; anInd > 0; anInd--)
|
||||||
|
{
|
||||||
|
Standard_Character aChar = theBuffer.Line[anInd];
|
||||||
|
if (aChar == ',' || aChar == ' ')
|
||||||
|
{
|
||||||
|
theBuffer.Line[anInd + 1] = '\0';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (anInd == 0) // no possible to rolling back
|
||||||
|
{
|
||||||
|
return VrmlData_UnrecoverableError;
|
||||||
|
}
|
||||||
|
theBuffer.Input.seekg(-(aNbChars - anInd - 1), std::ios::cur);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check the reading status.
|
||||||
|
theBuffer.LineCount++;
|
||||||
|
const int stat = theBuffer.Input.rdstate();
|
||||||
|
if (stat & std::ios::badbit)
|
||||||
|
{
|
||||||
|
aStatus = VrmlData_UnrecoverableError;
|
||||||
|
}
|
||||||
|
else if (stat & std::ios::failbit)
|
||||||
|
{
|
||||||
|
if (stat & std::ios::eofbit)
|
||||||
|
{
|
||||||
|
aStatus = VrmlData_EndOfFile;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aStatus = VrmlData_GeneralError;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
theBuffer.LinePtr = &theBuffer.Line[0];
|
||||||
|
theBuffer.IsProcessed = Standard_False;
|
||||||
return aStatus;
|
return aStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -89,7 +89,7 @@ Standard_Boolean XCAFDoc_ColorTool::IsColor (const TDF_Label& lab) const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean XCAFDoc_ColorTool::GetColor (const TDF_Label& lab,
|
Standard_Boolean XCAFDoc_ColorTool::GetColor (const TDF_Label& lab,
|
||||||
Quantity_Color& col) const
|
Quantity_Color& col)
|
||||||
{
|
{
|
||||||
Quantity_ColorRGBA aCol;
|
Quantity_ColorRGBA aCol;
|
||||||
Standard_Boolean isDone = GetColor(lab, aCol);
|
Standard_Boolean isDone = GetColor(lab, aCol);
|
||||||
@@ -104,10 +104,8 @@ Standard_Boolean XCAFDoc_ColorTool::GetColor (const TDF_Label& lab,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean XCAFDoc_ColorTool::GetColor(const TDF_Label& lab,
|
Standard_Boolean XCAFDoc_ColorTool::GetColor(const TDF_Label& lab,
|
||||||
Quantity_ColorRGBA& col) const
|
Quantity_ColorRGBA& col)
|
||||||
{
|
{
|
||||||
if (lab.Father() != Label()) return Standard_False;
|
|
||||||
|
|
||||||
Handle(XCAFDoc_Color) ColorAttribute;
|
Handle(XCAFDoc_Color) ColorAttribute;
|
||||||
if (!lab.FindAttribute(XCAFDoc_Color::GetID(), ColorAttribute))
|
if (!lab.FindAttribute(XCAFDoc_Color::GetID(), ColorAttribute))
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
@@ -514,7 +512,7 @@ XCAFDoc_ColorTool::XCAFDoc_ColorTool()
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean XCAFDoc_ColorTool::IsVisible (const TDF_Label& L) const
|
Standard_Boolean XCAFDoc_ColorTool::IsVisible (const TDF_Label& L)
|
||||||
{
|
{
|
||||||
Handle(TDataStd_UAttribute) aUAttr;
|
Handle(TDataStd_UAttribute) aUAttr;
|
||||||
return (!L.FindAttribute(XCAFDoc::InvisibleGUID(), aUAttr));
|
return (!L.FindAttribute(XCAFDoc::InvisibleGUID(), aUAttr));
|
||||||
|
@@ -72,12 +72,12 @@ public:
|
|||||||
//! Returns color defined by label lab
|
//! Returns color defined by label lab
|
||||||
//! Returns False if the label is not in colortable
|
//! Returns False if the label is not in colortable
|
||||||
//! or does not define a color
|
//! or does not define a color
|
||||||
Standard_EXPORT Standard_Boolean GetColor (const TDF_Label& lab, Quantity_Color& col) const;
|
Standard_EXPORT static Standard_Boolean GetColor (const TDF_Label& lab, Quantity_Color& col);
|
||||||
|
|
||||||
//! Returns color defined by label lab
|
//! Returns color defined by label lab
|
||||||
//! Returns False if the label is not in colortable
|
//! Returns False if the label is not in colortable
|
||||||
//! or does not define a color
|
//! or does not define a color
|
||||||
Standard_EXPORT Standard_Boolean GetColor(const TDF_Label& lab, Quantity_ColorRGBA& col) const;
|
Standard_EXPORT static Standard_Boolean GetColor(const TDF_Label& lab, Quantity_ColorRGBA& col);
|
||||||
|
|
||||||
//! Finds a color definition in a colortable and returns
|
//! Finds a color definition in a colortable and returns
|
||||||
//! its label if found
|
//! its label if found
|
||||||
@@ -150,11 +150,11 @@ public:
|
|||||||
|
|
||||||
//! Returns color assigned to <L> as <type>
|
//! Returns color assigned to <L> as <type>
|
||||||
//! Returns False if no such color is assigned
|
//! Returns False if no such color is assigned
|
||||||
Standard_EXPORT Standard_Boolean GetColor (const TDF_Label& L, const XCAFDoc_ColorType type, Quantity_Color& color);
|
Standard_EXPORT static Standard_Boolean GetColor (const TDF_Label& L, const XCAFDoc_ColorType type, Quantity_Color& color);
|
||||||
|
|
||||||
//! Returns color assigned to <L> as <type>
|
//! Returns color assigned to <L> as <type>
|
||||||
//! Returns False if no such color is assigned
|
//! Returns False if no such color is assigned
|
||||||
Standard_EXPORT Standard_Boolean GetColor(const TDF_Label& L, const XCAFDoc_ColorType type, Quantity_ColorRGBA& color);
|
Standard_EXPORT static Standard_Boolean GetColor(const TDF_Label& L, const XCAFDoc_ColorType type, Quantity_ColorRGBA& color);
|
||||||
|
|
||||||
//! Sets a link with GUID defined by <type> (see
|
//! Sets a link with GUID defined by <type> (see
|
||||||
//! XCAFDoc::ColorRefGUID()) from label <L> to color
|
//! XCAFDoc::ColorRefGUID()) from label <L> to color
|
||||||
@@ -198,7 +198,7 @@ public:
|
|||||||
Standard_EXPORT Standard_Boolean GetColor(const TopoDS_Shape& S, const XCAFDoc_ColorType type, Quantity_ColorRGBA& color);
|
Standard_EXPORT Standard_Boolean GetColor(const TopoDS_Shape& S, const XCAFDoc_ColorType type, Quantity_ColorRGBA& color);
|
||||||
|
|
||||||
//! Return TRUE if object on this label is visible, FALSE if invisible.
|
//! Return TRUE if object on this label is visible, FALSE if invisible.
|
||||||
Standard_EXPORT Standard_Boolean IsVisible (const TDF_Label& L) const;
|
Standard_EXPORT static Standard_Boolean IsVisible (const TDF_Label& L);
|
||||||
|
|
||||||
//! Set the visibility of object on label. Do nothing if there no any object.
|
//! Set the visibility of object on label. Do nothing if there no any object.
|
||||||
//! Set UAttribute with corresponding GUID.
|
//! Set UAttribute with corresponding GUID.
|
||||||
|
@@ -503,7 +503,7 @@ TDF_Label XCAFDoc_DimTolTool::SetDimTol(const TDF_Label& L,
|
|||||||
|
|
||||||
Standard_Boolean XCAFDoc_DimTolTool::GetRefShapeLabel(const TDF_Label& theL,
|
Standard_Boolean XCAFDoc_DimTolTool::GetRefShapeLabel(const TDF_Label& theL,
|
||||||
TDF_LabelSequence& theShapeLFirst,
|
TDF_LabelSequence& theShapeLFirst,
|
||||||
TDF_LabelSequence& theShapeLSecond) const
|
TDF_LabelSequence& theShapeLSecond)
|
||||||
{
|
{
|
||||||
theShapeLFirst.Clear();
|
theShapeLFirst.Clear();
|
||||||
theShapeLSecond.Clear();
|
theShapeLSecond.Clear();
|
||||||
@@ -855,7 +855,7 @@ Standard_Boolean XCAFDoc_DimTolTool::GetDatum(const TDF_Label& theDatumL,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean XCAFDoc_DimTolTool::GetDatumOfTolerLabels(const TDF_Label& theDimTolL,
|
Standard_Boolean XCAFDoc_DimTolTool::GetDatumOfTolerLabels(const TDF_Label& theDimTolL,
|
||||||
TDF_LabelSequence& theDatums) const
|
TDF_LabelSequence& theDatums)
|
||||||
{
|
{
|
||||||
Handle(XCAFDoc_GraphNode) aNode;
|
Handle(XCAFDoc_GraphNode) aNode;
|
||||||
if( !theDimTolL.FindAttribute(XCAFDoc::DatumTolRefGUID(),aNode) )
|
if( !theDimTolL.FindAttribute(XCAFDoc::DatumTolRefGUID(),aNode) )
|
||||||
@@ -874,7 +874,7 @@ Standard_Boolean XCAFDoc_DimTolTool::GetDatumOfTolerLabels(const TDF_Label& theD
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean XCAFDoc_DimTolTool::GetDatumWithObjectOfTolerLabels(const TDF_Label& theDimTolL,
|
Standard_Boolean XCAFDoc_DimTolTool::GetDatumWithObjectOfTolerLabels(const TDF_Label& theDimTolL,
|
||||||
TDF_LabelSequence& theDatums) const
|
TDF_LabelSequence& theDatums)
|
||||||
{
|
{
|
||||||
Handle(XCAFDoc_GraphNode) aNode;
|
Handle(XCAFDoc_GraphNode) aNode;
|
||||||
if( !theDimTolL.FindAttribute(XCAFDoc::DatumTolRefGUID(),aNode) )
|
if( !theDimTolL.FindAttribute(XCAFDoc::DatumTolRefGUID(),aNode) )
|
||||||
|
@@ -155,9 +155,9 @@ public:
|
|||||||
|
|
||||||
//! Gets all shape labels referred by theL label of the GD&T table.
|
//! Gets all shape labels referred by theL label of the GD&T table.
|
||||||
//! Returns False if there are no shape labels added to the sequences.
|
//! Returns False if there are no shape labels added to the sequences.
|
||||||
Standard_EXPORT Standard_Boolean GetRefShapeLabel (const TDF_Label& theL,
|
Standard_EXPORT static Standard_Boolean GetRefShapeLabel (const TDF_Label& theL,
|
||||||
TDF_LabelSequence& theShapeLFirst,
|
TDF_LabelSequence& theShapeLFirst,
|
||||||
TDF_LabelSequence& theShapeLSecond) const;
|
TDF_LabelSequence& theShapeLSecond);
|
||||||
|
|
||||||
//! Returns dimension tolerance assigned to theDimTolL label.
|
//! Returns dimension tolerance assigned to theDimTolL label.
|
||||||
//! Returns False if no such dimension tolerance is assigned.
|
//! Returns False if no such dimension tolerance is assigned.
|
||||||
@@ -215,12 +215,12 @@ public:
|
|||||||
Handle(TCollection_HAsciiString)& theIdentification) const;
|
Handle(TCollection_HAsciiString)& theIdentification) const;
|
||||||
|
|
||||||
//! Returns all Datum labels defined for theDimTolL label.
|
//! Returns all Datum labels defined for theDimTolL label.
|
||||||
Standard_EXPORT Standard_Boolean GetDatumOfTolerLabels (const TDF_Label& theDimTolL,
|
Standard_EXPORT static Standard_Boolean GetDatumOfTolerLabels (const TDF_Label& theDimTolL,
|
||||||
TDF_LabelSequence& theDatums) const;
|
TDF_LabelSequence& theDatums);
|
||||||
|
|
||||||
//! Returns all Datum labels with XCAFDimTolObjects_DatumObject defined for label theDimTolL.
|
//! Returns all Datum labels with XCAFDimTolObjects_DatumObject defined for label theDimTolL.
|
||||||
Standard_EXPORT Standard_Boolean GetDatumWithObjectOfTolerLabels (const TDF_Label& theDimTolL,
|
Standard_EXPORT static Standard_Boolean GetDatumWithObjectOfTolerLabels (const TDF_Label& theDimTolL,
|
||||||
TDF_LabelSequence& theDatums) const;
|
TDF_LabelSequence& theDatums);
|
||||||
|
|
||||||
//! Returns all GeomToleranses labels defined for theDatumL label.
|
//! Returns all GeomToleranses labels defined for theDatumL label.
|
||||||
Standard_EXPORT Standard_Boolean GetTolerOfDatumLabels (const TDF_Label& theDatumL,
|
Standard_EXPORT Standard_Boolean GetTolerOfDatumLabels (const TDF_Label& theDatumL,
|
||||||
|
@@ -416,20 +416,20 @@ Handle(TColStd_HSequenceOfExtendedString) XCAFDoc_LayerTool::GetLayers(const TDF
|
|||||||
//function : GetShapesOfLayer
|
//function : GetShapesOfLayer
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
void XCAFDoc_LayerTool::GetShapesOfLayer(const TDF_Label& theLayerL,
|
||||||
void XCAFDoc_LayerTool::GetShapesOfLayer(const TDF_Label& layerL,
|
TDF_LabelSequence& theShLabels)
|
||||||
TDF_LabelSequence& ShLabels) const
|
|
||||||
{
|
{
|
||||||
ShLabels.Clear();
|
theShLabels.Clear();
|
||||||
Handle(XCAFDoc_GraphNode) aGNode;
|
Handle(XCAFDoc_GraphNode) aGNode;
|
||||||
if ( layerL.FindAttribute( XCAFDoc::LayerRefGUID(), aGNode) ) {
|
if (theLayerL.FindAttribute(XCAFDoc::LayerRefGUID(), aGNode))
|
||||||
for (Standard_Integer i = 1; i <= aGNode->NbChildren(); i++) {
|
{
|
||||||
ShLabels.Append( aGNode->GetChild(i)->Label() );
|
for (Standard_Integer aChildInd = 1; aChildInd <= aGNode->NbChildren(); aChildInd++)
|
||||||
|
{
|
||||||
|
theShLabels.Append(aGNode->GetChild(aChildInd)->Label());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsVisible
|
//function : IsVisible
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@@ -135,7 +135,7 @@ public:
|
|||||||
Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetLayers (const TDF_Label& L);
|
Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetLayers (const TDF_Label& L);
|
||||||
|
|
||||||
//! Return sequanese of shape labels that assigned with layers to <ShLabels>.
|
//! Return sequanese of shape labels that assigned with layers to <ShLabels>.
|
||||||
Standard_EXPORT void GetShapesOfLayer (const TDF_Label& layerL, TDF_LabelSequence& ShLabels) const;
|
Standard_EXPORT static void GetShapesOfLayer (const TDF_Label& theLayerL, TDF_LabelSequence& theShLabels);
|
||||||
|
|
||||||
//! Return TRUE if layer is visible, FALSE if invisible.
|
//! Return TRUE if layer is visible, FALSE if invisible.
|
||||||
Standard_EXPORT Standard_Boolean IsVisible (const TDF_Label& layerL) const;
|
Standard_EXPORT Standard_Boolean IsVisible (const TDF_Label& layerL) const;
|
||||||
|
@@ -184,7 +184,7 @@ Standard_Boolean XCAFDoc_MaterialTool::GetMaterial(const TDF_Label& MatL,
|
|||||||
Handle(TCollection_HAsciiString)& aDescription,
|
Handle(TCollection_HAsciiString)& aDescription,
|
||||||
Standard_Real& aDensity,
|
Standard_Real& aDensity,
|
||||||
Handle(TCollection_HAsciiString)& aDensName,
|
Handle(TCollection_HAsciiString)& aDensName,
|
||||||
Handle(TCollection_HAsciiString)& aDensValType) const
|
Handle(TCollection_HAsciiString)& aDensValType)
|
||||||
{
|
{
|
||||||
Handle(XCAFDoc_Material) MatAttr;
|
Handle(XCAFDoc_Material) MatAttr;
|
||||||
if(!MatL.FindAttribute(XCAFDoc_Material::GetID(),MatAttr)) {
|
if(!MatL.FindAttribute(XCAFDoc_Material::GetID(),MatAttr)) {
|
||||||
|
@@ -76,7 +76,7 @@ public:
|
|||||||
|
|
||||||
//! Returns Material assigned to <MatL>
|
//! Returns Material assigned to <MatL>
|
||||||
//! Returns False if no such Material is assigned
|
//! Returns False if no such Material is assigned
|
||||||
Standard_EXPORT Standard_Boolean GetMaterial (const TDF_Label& MatL, Handle(TCollection_HAsciiString)& aName, Handle(TCollection_HAsciiString)& aDescription, Standard_Real& aDensity, Handle(TCollection_HAsciiString)& aDensName, Handle(TCollection_HAsciiString)& aDensValType) const;
|
Standard_EXPORT static Standard_Boolean GetMaterial (const TDF_Label& MatL, Handle(TCollection_HAsciiString)& aName, Handle(TCollection_HAsciiString)& aDescription, Standard_Real& aDensity, Handle(TCollection_HAsciiString)& aDensName, Handle(TCollection_HAsciiString)& aDensValType);
|
||||||
|
|
||||||
//! Find referred material and return density from it
|
//! Find referred material and return density from it
|
||||||
//! if no material --> return 0
|
//! if no material --> return 0
|
||||||
|
@@ -353,6 +353,47 @@ TopoDS_Shape XCAFDoc_ShapeTool::GetShape(const TDF_Label& L)
|
|||||||
return aShape;
|
return aShape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GetShapes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
TopoDS_Shape XCAFDoc_ShapeTool::GetOneShape(const TDF_LabelSequence& theLabels)
|
||||||
|
{
|
||||||
|
TopoDS_Shape aShape;
|
||||||
|
if (theLabels.Length() == 1)
|
||||||
|
{
|
||||||
|
return GetShape(theLabels.Value(1));
|
||||||
|
}
|
||||||
|
TopoDS_Compound aCompound;
|
||||||
|
BRep_Builder aBuilder;
|
||||||
|
aBuilder.MakeCompound(aCompound);
|
||||||
|
for (TDF_LabelSequence::Iterator anIt(theLabels); anIt.More(); anIt.Next())
|
||||||
|
{
|
||||||
|
TopoDS_Shape aFreeShape;
|
||||||
|
if (!GetShape(anIt.Value(), aFreeShape))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
aBuilder.Add(aCompound, aFreeShape);
|
||||||
|
}
|
||||||
|
if (aCompound.NbChildren() > 0)
|
||||||
|
{
|
||||||
|
aShape = aCompound;
|
||||||
|
}
|
||||||
|
return aShape;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GetOneShape
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
TopoDS_Shape XCAFDoc_ShapeTool::GetOneShape() const
|
||||||
|
{
|
||||||
|
TDF_LabelSequence aLabels;
|
||||||
|
GetFreeShapes(aLabels);
|
||||||
|
return GetOneShape(aLabels);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : NewShape
|
//function : NewShape
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@@ -196,6 +196,15 @@ public:
|
|||||||
//! For component, returns new shape with correct location
|
//! For component, returns new shape with correct location
|
||||||
//! Returns Null shape if label does not contain shape
|
//! Returns Null shape if label does not contain shape
|
||||||
Standard_EXPORT static TopoDS_Shape GetShape (const TDF_Label& L);
|
Standard_EXPORT static TopoDS_Shape GetShape (const TDF_Label& L);
|
||||||
|
|
||||||
|
//! Gets shape from a sequence of shape's labels
|
||||||
|
//! @param[in] theLabels a sequence of labels to get shapes from
|
||||||
|
//! @return original shape in case of one label and a compound of shapes in case of more
|
||||||
|
Standard_EXPORT static TopoDS_Shape GetOneShape(const TDF_LabelSequence& theLabels);
|
||||||
|
|
||||||
|
//! Gets shape from a sequence of all top-level shapes which are free
|
||||||
|
//! @return original shape in case of one label and a compound of shapes in case of more
|
||||||
|
Standard_EXPORT TopoDS_Shape GetOneShape() const;
|
||||||
|
|
||||||
//! Creates new (empty) top-level shape.
|
//! Creates new (empty) top-level shape.
|
||||||
//! Initially it holds empty TopoDS_Compound
|
//! Initially it holds empty TopoDS_Compound
|
||||||
|
@@ -79,13 +79,10 @@ const Handle(XCAFDoc_ShapeTool)& XCAFDoc_VisMaterialTool::ShapeTool()
|
|||||||
//function : GetMaterial
|
//function : GetMaterial
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Handle(XCAFDoc_VisMaterial) XCAFDoc_VisMaterialTool::GetMaterial (const TDF_Label& theMatLabel) const
|
Handle(XCAFDoc_VisMaterial) XCAFDoc_VisMaterialTool::GetMaterial(const TDF_Label& theMatLabel)
|
||||||
{
|
{
|
||||||
Handle(XCAFDoc_VisMaterial) aMatAttrib;
|
Handle(XCAFDoc_VisMaterial) aMatAttrib;
|
||||||
if (theMatLabel.Father() == Label())
|
theMatLabel.FindAttribute(XCAFDoc_VisMaterial::GetID(), aMatAttrib);
|
||||||
{
|
|
||||||
theMatLabel.FindAttribute (XCAFDoc_VisMaterial::GetID(), aMatAttrib);
|
|
||||||
}
|
|
||||||
return aMatAttrib;
|
return aMatAttrib;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,8 +211,7 @@ Standard_Boolean XCAFDoc_VisMaterialTool::GetShapeMaterial (const TDF_Label& the
|
|||||||
Handle(XCAFDoc_VisMaterial) XCAFDoc_VisMaterialTool::GetShapeMaterial (const TDF_Label& theShapeLabel)
|
Handle(XCAFDoc_VisMaterial) XCAFDoc_VisMaterialTool::GetShapeMaterial (const TDF_Label& theShapeLabel)
|
||||||
{
|
{
|
||||||
TDF_Label aMatLabel;
|
TDF_Label aMatLabel;
|
||||||
return Label().HasChild() // do not waste time on shape attributes if materials map is empty
|
return GetShapeMaterial (theShapeLabel, aMatLabel)
|
||||||
&& GetShapeMaterial (theShapeLabel, aMatLabel)
|
|
||||||
? GetMaterial (aMatLabel)
|
? GetMaterial (aMatLabel)
|
||||||
: Handle(XCAFDoc_VisMaterial)();
|
: Handle(XCAFDoc_VisMaterial)();
|
||||||
}
|
}
|
||||||
|
@@ -56,7 +56,7 @@ public:
|
|||||||
Standard_Boolean IsMaterial (const TDF_Label& theLabel) const { return !GetMaterial (theLabel).IsNull(); }
|
Standard_Boolean IsMaterial (const TDF_Label& theLabel) const { return !GetMaterial (theLabel).IsNull(); }
|
||||||
|
|
||||||
//! Returns Material defined by specified Label, or NULL if the label is not in Material Table.
|
//! Returns Material defined by specified Label, or NULL if the label is not in Material Table.
|
||||||
Standard_EXPORT Handle(XCAFDoc_VisMaterial) GetMaterial (const TDF_Label& theMatLabel) const;
|
Standard_EXPORT static Handle(XCAFDoc_VisMaterial) GetMaterial (const TDF_Label& theMatLabel);
|
||||||
|
|
||||||
//! Adds Material definition to a Material Table and returns its Label.
|
//! Adds Material definition to a Material Table and returns its Label.
|
||||||
Standard_EXPORT TDF_Label AddMaterial (const Handle(XCAFDoc_VisMaterial)& theMat,
|
Standard_EXPORT TDF_Label AddMaterial (const Handle(XCAFDoc_VisMaterial)& theMat,
|
||||||
@@ -88,7 +88,7 @@ public:
|
|||||||
Standard_EXPORT static Standard_Boolean GetShapeMaterial (const TDF_Label& theShapeLabel, TDF_Label& theMaterialLabel);
|
Standard_EXPORT static Standard_Boolean GetShapeMaterial (const TDF_Label& theShapeLabel, TDF_Label& theMaterialLabel);
|
||||||
|
|
||||||
//! Returns material assigned to the shape label.
|
//! Returns material assigned to the shape label.
|
||||||
Standard_EXPORT Handle(XCAFDoc_VisMaterial) GetShapeMaterial (const TDF_Label& theShapeLabel);
|
Standard_EXPORT static Handle(XCAFDoc_VisMaterial) GetShapeMaterial (const TDF_Label& theShapeLabel);
|
||||||
|
|
||||||
//! Sets a link with GUID XCAFDoc::VisMaterialRefGUID() from shape label to material label.
|
//! Sets a link with GUID XCAFDoc::VisMaterialRefGUID() from shape label to material label.
|
||||||
//! @param theShape [in] shape
|
//! @param theShape [in] shape
|
||||||
|
@@ -509,40 +509,37 @@ static Standard_Integer getFreeShapes (Draw_Interpretor& di, Standard_Integer ar
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Standard_Integer getOneShape (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
//=======================================================================
|
||||||
|
//function : getOneShape
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
static Standard_Integer getOneShape (Draw_Interpretor& theDI,
|
||||||
|
Standard_Integer theNbArgs,
|
||||||
|
const char** theArgVec)
|
||||||
{
|
{
|
||||||
if (argc!=3) {
|
if ( theNbArgs !=3 )
|
||||||
di<<"Use: "<<argv[0]<<" shape DocName \n";
|
{
|
||||||
|
theDI <<"Use: "<< theArgVec[0]<<" shape DocName \n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(TDocStd_Document) Doc;
|
Handle(TDocStd_Document) aDoc;
|
||||||
DDocStd::GetDocument(argv[2], Doc);
|
DDocStd::GetDocument(theArgVec[2], aDoc);
|
||||||
if ( Doc.IsNull() ) { di << argv[2] << " is not a document\n"; return 1; }
|
if ( aDoc.IsNull() )
|
||||||
|
{
|
||||||
|
theDI << "Error: " << theArgVec[2] << " is not a document\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
TDF_LabelSequence Labels;
|
Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
|
||||||
Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
|
TopoDS_Shape aShape = aSTool->GetOneShape();
|
||||||
STool->GetFreeShapes(Labels);
|
if (aShape.IsNull())
|
||||||
if ( Labels.Length() <=0 ) {
|
{
|
||||||
di << "Document " << argv[2] << " contain no shapes\n";
|
theDI << "Error: Document " << theArgVec[2] << " contain no shapes\n";
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
DBRep::Set (theArgVec[1], aShape);
|
||||||
if ( Labels.Length() ==1 ) {
|
theDI << theArgVec[1];
|
||||||
TopoDS_Shape S = STool->GetShape ( Labels.Value(1) );
|
|
||||||
DBRep::Set ( argv[1], S );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
TopoDS_Compound C;
|
|
||||||
BRep_Builder B;
|
|
||||||
B.MakeCompound ( C );
|
|
||||||
for ( Standard_Integer i = 1; i<= Labels.Length(); i++) {
|
|
||||||
TopoDS_Shape S = STool->GetShape ( Labels.Value(i) );
|
|
||||||
B.Add ( C, S );
|
|
||||||
}
|
|
||||||
DBRep::Set ( argv[1], C );
|
|
||||||
}
|
|
||||||
di << argv[1];
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3,8 +3,6 @@
|
|||||||
#
|
#
|
||||||
#Create 3 torus
|
#Create 3 torus
|
||||||
|
|
||||||
puts "TODO CR33225 Linux: Error : The area of result shape is 138625, expected 197700"
|
|
||||||
|
|
||||||
ptorus a0 100 20
|
ptorus a0 100 20
|
||||||
tcopy a0 a1
|
tcopy a0 a1
|
||||||
tcopy a0 a2
|
tcopy a0 a2
|
||||||
|
24
tests/bugs/caf/bug114
Executable file
24
tests/bugs/caf/bug114
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
puts "==========="
|
||||||
|
puts "OCC114"
|
||||||
|
puts "==========="
|
||||||
|
|
||||||
|
# Max number of iterations for computing memory leackage
|
||||||
|
set i_max 10
|
||||||
|
puts "Amount of iterations is $i_max"
|
||||||
|
|
||||||
|
NewDocument D BinOcaf
|
||||||
|
UndoLimit D 10
|
||||||
|
|
||||||
|
restore [locate_data_file OCC294.brep] s
|
||||||
|
|
||||||
|
set listmem {}
|
||||||
|
for {set i 1} {${i} <= ${i_max}} {incr i} {
|
||||||
|
|
||||||
|
OpenCommand D
|
||||||
|
SetShape D 0:1 s
|
||||||
|
AbortCommand D
|
||||||
|
|
||||||
|
# check memory usage (with tolerance equal to half page size)
|
||||||
|
lappend listmem [meminfo h]
|
||||||
|
checktrend $listmem 50 50 "Memory leak detected"
|
||||||
|
}
|
17
tests/bugs/caf/bug26293_2
Normal file
17
tests/bugs/caf/bug26293_2
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
puts "==========="
|
||||||
|
puts "OCC26293"
|
||||||
|
puts "==========="
|
||||||
|
puts ""
|
||||||
|
#################################
|
||||||
|
# Error opening the document
|
||||||
|
#################################
|
||||||
|
|
||||||
|
Open [locate_data_file bug26293_all_geom.sgd] D
|
||||||
|
vinit
|
||||||
|
for {set i 1} {$i < 1065} {incr i} {
|
||||||
|
if { ![catch {GetShape D 0:1:$i:1:1:2 res$i}] } {
|
||||||
|
vdisplay res$i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vfit
|
||||||
|
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|
@@ -1,5 +1,3 @@
|
|||||||
puts "TODO ?CR33225 Windows: Failed class "
|
|
||||||
|
|
||||||
pload QAcommands
|
pload QAcommands
|
||||||
|
|
||||||
QANTestStlIterators
|
QANTestStlIterators
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
puts "TODO ?СК33225 Linux: Checking trend failed "
|
|
||||||
puts "TODO ?OCC7287 Linux: Tcl Exception: Memory leak detected"
|
puts "TODO ?OCC7287 Linux: Tcl Exception: Memory leak detected"
|
||||||
puts "TODO ?OCC7287 Linux: TEST INCOMPLETE"
|
puts "TODO ?OCC7287 Linux: TEST INCOMPLETE"
|
||||||
puts "TODO ?OCC7287 MacOS: Tcl Exception: Memory leak detected"
|
puts "TODO ?OCC7287 MacOS: Tcl Exception: Memory leak detected"
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
puts "TODO ?CR332257287 Linux: Checking trend failed: mean delta per step = 9432.0, sigma = 4220.013270121316, expected delta = 0"
|
|
||||||
puts "TODO ?OCC7287 Linux: Tcl Exception: Memory leak detected"
|
puts "TODO ?OCC7287 Linux: Tcl Exception: Memory leak detected"
|
||||||
puts "TODO ?OCC7287 Linux: TEST INCOMPLETE"
|
puts "TODO ?OCC7287 Linux: TEST INCOMPLETE"
|
||||||
puts "TODO ?OCC7287 MacOS: Tcl Exception: Memory leak detected"
|
puts "TODO ?OCC7287 MacOS: Tcl Exception: Memory leak detected"
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
puts "TODO ?CR33225 Linux: Checking trend failed: mean delta per step = 7408.0, sigma = 2737.917456754312, expected delta = 0"
|
|
||||||
puts "TODO ?OCC7287 Linux: Tcl Exception: Memory leak detected"
|
puts "TODO ?OCC7287 Linux: Tcl Exception: Memory leak detected"
|
||||||
puts "TODO ?OCC7287 Linux: TEST INCOMPLETE"
|
puts "TODO ?OCC7287 Linux: TEST INCOMPLETE"
|
||||||
puts "TODO ?OCC7287 MacOS: Tcl Exception: Memory leak detected"
|
puts "TODO ?OCC7287 MacOS: Tcl Exception: Memory leak detected"
|
||||||
|
18
tests/bugs/mesh/bug32424
Normal file
18
tests/bugs/mesh/bug32424
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
puts "======="
|
||||||
|
puts "0032424: Mesh - Slow triangulation of a simple shape."
|
||||||
|
puts "======="
|
||||||
|
puts ""
|
||||||
|
cpulimit 3
|
||||||
|
|
||||||
|
restore [locate_data_file bug32424.brep] result
|
||||||
|
|
||||||
|
incmesh result 0.17 -a 20
|
||||||
|
|
||||||
|
checktrinfo result -tri 2360 -nod 1302
|
||||||
|
|
||||||
|
vinit
|
||||||
|
vdefaults -autoTriang 0
|
||||||
|
vsetdispmode 1
|
||||||
|
vdisplay result
|
||||||
|
vfit
|
||||||
|
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|
24
tests/bugs/mesh/bug33315
Normal file
24
tests/bugs/mesh/bug33315
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0033315: Mesh - BRepMesh_IncrementalMesh takes forever to finish (ends up with system memory, etc)"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug33315.brep] result
|
||||||
|
|
||||||
|
incmesh result 3.5 -a 20
|
||||||
|
checktrinfo result -tri 1516 -nod 1118
|
||||||
|
|
||||||
|
vinit
|
||||||
|
vsetdispmode 1
|
||||||
|
vdefaults -autoTriang 0
|
||||||
|
vdisplay result
|
||||||
|
vfit
|
||||||
|
|
||||||
|
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|
||||||
|
|
||||||
|
set log [tricheck result]
|
||||||
|
if { [llength $log] != 0 } {
|
||||||
|
puts "Error : Invalid mesh"
|
||||||
|
} else {
|
||||||
|
puts "Mesh is OK"
|
||||||
|
}
|
@@ -1,12 +1,7 @@
|
|||||||
puts "TODO CR33225 Linux: Error : The command is not valid. The area is 0."
|
|
||||||
puts "TODO CR33225 Linux: Error : The area of result shape is 0, expected 177462"
|
|
||||||
puts "TODO CR33225 Linux: is WRONG because number of "
|
|
||||||
|
|
||||||
puts "============"
|
puts "============"
|
||||||
puts "OCC19071"
|
puts "OCC19071"
|
||||||
puts "============"
|
puts "============"
|
||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# The MakeFuse or the MakePartition function crash together on 2 torus
|
# The MakeFuse or the MakePartition function crash together on 2 torus
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
puts "TODO OCC26556 ALL: ERROR. offsetperform operation not done."
|
puts "TODO OCC26556 ALL: ERROR. Mixed connectivity of faces."
|
||||||
|
|
||||||
puts "============"
|
puts "============"
|
||||||
puts "OCC5805"
|
puts "OCC5805"
|
||||||
@@ -20,6 +20,7 @@ if { [catch { offsetshape result a -1 a_6 } catch_result] } {
|
|||||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if { [isdraw result] } {
|
||||||
checkmaxtol result -min_tol 1.
|
checkmaxtol result -min_tol 1.
|
||||||
|
|
||||||
checkprops result -s 1185.03
|
checkprops result -s 1185.03
|
||||||
@@ -27,3 +28,4 @@ checkshape result
|
|||||||
|
|
||||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||||
|
}
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
|
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||||
puts "TODO OCC25925 ALL: Tcl Exception:"
|
|
||||||
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
|
|
||||||
|
|
||||||
puts "============"
|
puts "============"
|
||||||
puts "OCC5805"
|
puts "OCC5805"
|
||||||
@@ -25,6 +23,7 @@ if { [catch { offsetperform result } catch_result] } {
|
|||||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if { [isdraw result] } {
|
||||||
checkmaxtol result -min_tol 1.
|
checkmaxtol result -min_tol 1.
|
||||||
|
|
||||||
checkprops result -s 1185.03
|
checkprops result -s 1185.03
|
||||||
@@ -32,3 +31,4 @@ checkshape result
|
|||||||
|
|
||||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||||
|
}
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||||
|
|
||||||
puts "============"
|
puts "============"
|
||||||
puts "OCC5805"
|
puts "OCC5805"
|
||||||
puts "============"
|
puts "============"
|
||||||
@@ -21,6 +23,7 @@ if { [catch { offsetperform result } catch_result] } {
|
|||||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if { [isdraw result] } {
|
||||||
checkmaxtol result -min_tol 1.
|
checkmaxtol result -min_tol 1.
|
||||||
|
|
||||||
checkprops result -s 876.584
|
checkprops result -s 876.584
|
||||||
@@ -28,3 +31,5 @@ checkshape result
|
|||||||
|
|
||||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||||
|
}
|
||||||
|
|
@@ -1,3 +1,5 @@
|
|||||||
|
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||||
|
|
||||||
puts "============"
|
puts "============"
|
||||||
puts "OCC5805"
|
puts "OCC5805"
|
||||||
puts "============"
|
puts "============"
|
||||||
@@ -16,9 +18,12 @@ if { [catch { offsetshape result a -1 } catch_result] } {
|
|||||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if { [isdraw result] } {
|
||||||
checkmaxtol result -min_tol 1.
|
checkmaxtol result -min_tol 1.
|
||||||
|
|
||||||
checkprops result -s 876.584
|
checkprops result -s 876.584
|
||||||
checkshape result
|
checkshape result
|
||||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||||
|
}
|
||||||
|
|
@@ -1,5 +1,4 @@
|
|||||||
puts "TODO CR30351 Windows: Faulty OCC25199: Bad tolerance edge generated by blend algorithm"
|
puts "TODO CR30351 Windows: Faulty OCC25199: Bad tolerance edge generated by blend algorithm"
|
||||||
puts "TODO CR33225 Linux: Faulty OCC25199: Bad tolerance edge generated by blend algorithm"
|
|
||||||
|
|
||||||
puts "============"
|
puts "============"
|
||||||
puts "OCC25199"
|
puts "OCC25199"
|
||||||
|
20
tests/bugs/modalg_6/bug26616
Normal file
20
tests/bugs/modalg_6/bug26616
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC26616"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
############################################
|
||||||
|
# Memory leak in IntTools_Context::Hatcher
|
||||||
|
############################################
|
||||||
|
|
||||||
|
restore [locate_data_file OCC26635_t0.brep] t0
|
||||||
|
restore [locate_data_file OCC26635_t1.brep] t1
|
||||||
|
|
||||||
|
bfuse res t0 t1
|
||||||
|
|
||||||
|
set listmem {}
|
||||||
|
for {set i 1} {$i < 10} {incr i} {
|
||||||
|
bfuse res t0 t1
|
||||||
|
|
||||||
|
lappend listmem [meminfo h]
|
||||||
|
checktrend $listmem 0 64 "Memory leak detected"
|
||||||
|
}
|
@@ -3,8 +3,6 @@ puts "OCC27884: Modeling Algorithms - Possible improvement for 2d classifier"
|
|||||||
puts "================================================================="
|
puts "================================================================="
|
||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
puts "TODO ?CR33225 Windows: Error: algorithm slowed down"
|
|
||||||
|
|
||||||
pload ALL
|
pload ALL
|
||||||
pload QAcommands
|
pload QAcommands
|
||||||
|
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
puts "TODO ?CR33225 Windows: extra characters after close-quote "
|
|
||||||
|
|
||||||
puts "========"
|
puts "========"
|
||||||
puts "OCC29293"
|
puts "OCC29293"
|
||||||
puts "========"
|
puts "========"
|
||||||
|
48
tests/bugs/modalg_7/bug29843_1
Normal file
48
tests/bugs/modalg_7/bug29843_1
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0029843: Modeling Algorithms - Boolean FUSE produces incorrect result"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug29843.brep] s
|
||||||
|
|
||||||
|
explode s
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects s_1
|
||||||
|
baddtools s_2
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
bbop r_0 0
|
||||||
|
bbop r_1 1
|
||||||
|
bbop r_2 2
|
||||||
|
bbop r_3 3
|
||||||
|
bbop r_4 4
|
||||||
|
bbuild r_5
|
||||||
|
|
||||||
|
foreach i { 0 1 2 3 4 5} {
|
||||||
|
checkshape r_$i
|
||||||
|
if {![regexp "OK" [bopcheck r_$i]]} {
|
||||||
|
puts "Error: r_$i is self-intersecting shape"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
checkprops r_0 -s 9.84429 -v 0.639311
|
||||||
|
checknbshapes r_0 -wire 7 -face 5 -shell 1 -solid 1 -t
|
||||||
|
|
||||||
|
checkprops r_1 -s 2121.39 -v 612.41
|
||||||
|
checknbshapes r_1 -wire 38 -face 32 -shell 2 -solid 1 -t
|
||||||
|
|
||||||
|
checkprops r_2 -s 2113.85 -v 611.569
|
||||||
|
checknbshapes r_2 -wire 32 -face 26 -shell 2 -solid 1 -t
|
||||||
|
|
||||||
|
checkprops r_3 -s 15.9893 -v 0.215264
|
||||||
|
checknbshapes r_3 -wire 11 -face 9 -shell 2 -solid 2 -t
|
||||||
|
|
||||||
|
checkprops r_4 -l 24.9725
|
||||||
|
checksection r_4 -r 2
|
||||||
|
|
||||||
|
checkprops r_5 -s 2139.68 -v 612.402
|
||||||
|
checknbshapes r_5 -wire 44 -face 36 -shell 5 -solid 4 -t
|
||||||
|
|
||||||
|
checkview -display r_0 -2d -path ${imagedir}/${test_image}.png
|
||||||
|
|
16
tests/bugs/modalg_7/bug33265
Normal file
16
tests/bugs/modalg_7/bug33265
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "0033265: Modeling Algorithms - Boolean operation hangs on the attached shapes"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug33265.brep] hull
|
||||||
|
plane p 0 0.0001 0 0 1 0
|
||||||
|
mkface f p -150 150 -150 150
|
||||||
|
bop hull f
|
||||||
|
bopsection res
|
||||||
|
|
||||||
|
checknbshapes res -vertex 16 -edge 16
|
||||||
|
checkprops res -l 170.631
|
||||||
|
checksection res -r 0
|
||||||
|
|
||||||
|
checkview -display res -2d -path ${imagedir}/${test_image}.png
|
17
tests/bugs/modalg_8/bug31919
Normal file
17
tests/bugs/modalg_8/bug31919
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
puts "============================================================================================="
|
||||||
|
puts "0031919: Modeling Algorithms - General Fuse raises ex-ception on attempt to imprint a contour to a shell"
|
||||||
|
puts "============================================================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload ALL
|
||||||
|
restore [locate_data_file bug31919_Body.brep] body
|
||||||
|
restore [locate_data_file bug31919_Contour.brep] contour
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects body
|
||||||
|
baddtools contour
|
||||||
|
bfuzzyvalue 1
|
||||||
|
bfillds
|
||||||
|
bbop res 0
|
||||||
|
|
||||||
|
checknbshapes res -wire 1
|
18
tests/bugs/modalg_8/bug33113
Normal file
18
tests/bugs/modalg_8/bug33113
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
puts "================================"
|
||||||
|
puts "OCC33113: Modeling Algorithms - BRepFilletAPI_MakeFillet::Build SIGSEGV"
|
||||||
|
puts "================================"
|
||||||
|
|
||||||
|
restore [locate_data_file bug33113.brep] sh
|
||||||
|
|
||||||
|
explode sh e
|
||||||
|
copy sh_4 e
|
||||||
|
|
||||||
|
explode sh So
|
||||||
|
copy sh_1 s
|
||||||
|
|
||||||
|
fillet res s 0.1 e
|
||||||
|
|
||||||
|
checkshape res
|
||||||
|
|
||||||
|
checkview -display res -3d -path ${imagedir}/${test_image}.png
|
||||||
|
|
13
tests/bugs/modalg_8/bug33227
Normal file
13
tests/bugs/modalg_8/bug33227
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "0033227: Modeling Algorithm - BOPAlgo_BuilderSolid generates incomplete result"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug33227.brep] s
|
||||||
|
bopbsolid r s
|
||||||
|
compound r_2 r_3 res
|
||||||
|
|
||||||
|
checknbshapes res -shell 6 -solid 2
|
||||||
|
checkprops res -v 3.33117e+07
|
||||||
|
|
||||||
|
checkview -display res -2d -path ${imagedir}/${test_image}.png
|
13
tests/bugs/modalg_8/bug33247
Normal file
13
tests/bugs/modalg_8/bug33247
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "0033247: Modeling Algorithms - BOP report small edges problem and produce empty result"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug33247_object.brep] a
|
||||||
|
restore [locate_data_file bug33247_tool.brep] b
|
||||||
|
bcommon r a b
|
||||||
|
|
||||||
|
checknbshapes r -vertex 98 -edge 131 -wire 35 -face 26
|
||||||
|
checkprops r -s 157.39
|
||||||
|
|
||||||
|
checkview -display r -2d -path ${imagedir}/${test_image}.png
|
11
tests/bugs/modalg_8/bug33306
Normal file
11
tests/bugs/modalg_8/bug33306
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
puts "REQUIRED ALL: Algorithm has failed"
|
||||||
|
|
||||||
|
puts "========================"
|
||||||
|
puts "0033306: Modeling Algorithm - Crash in TrimEdge() method"
|
||||||
|
puts "========================"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug33306_1.brep] w1
|
||||||
|
restore [locate_data_file bug33306_2.brep] w2
|
||||||
|
|
||||||
|
thrusections res 0 0 w1 w2
|
11
tests/bugs/modalg_8/bug33311
Normal file
11
tests/bugs/modalg_8/bug33311
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
puts "========================"
|
||||||
|
puts "0033311: Modeling Algorithm - No results of thrusection algorithm"
|
||||||
|
puts "========================"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug33311_1.brep] w1
|
||||||
|
restore [locate_data_file bug33311_2.brep] w2
|
||||||
|
|
||||||
|
thrusections res 0 0 w1 w2
|
||||||
|
|
||||||
|
checkview -display res -2d -path ${imagedir}/${test_image}.png
|
@@ -2,9 +2,6 @@ puts "========"
|
|||||||
puts "OCC162"
|
puts "OCC162"
|
||||||
puts "========"
|
puts "========"
|
||||||
|
|
||||||
puts "TODO ?CR33225 Linux: Checking trend failed "
|
|
||||||
puts "TODO ?CR33225 Linux: Tcl Exception: Memory leak detected"
|
|
||||||
|
|
||||||
pload QAcommands
|
pload QAcommands
|
||||||
pload XDE
|
pload XDE
|
||||||
|
|
||||||
|
9
tests/bugs/moddata_3/bug33304
Normal file
9
tests/bugs/moddata_3/bug33304
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
puts "==========================================================="
|
||||||
|
puts "0033304: Modeling Data - Floating point signal when converting a B-spline curve to analytical form"
|
||||||
|
puts "==========================================================="
|
||||||
|
|
||||||
|
puts "REQUIRED ALL: Conversion failed"
|
||||||
|
|
||||||
|
binrestore [locate_data_file bug33304_bspl_curv.bbrep] a
|
||||||
|
mkcurve c a
|
||||||
|
tocanon r c
|
11
tests/bugs/step/bug33307
Normal file
11
tests/bugs/step/bug33307
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
puts "==================================================="
|
||||||
|
puts "0033307: Data Exchange, Step Import - Crash after reading empty edge loop"
|
||||||
|
puts "==================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload XDE OCAF
|
||||||
|
|
||||||
|
Close D -silent
|
||||||
|
|
||||||
|
ReadStep D [locate_data_file "bug33307.stp"]
|
||||||
|
Close D
|
32
tests/bugs/step/bug33317
Normal file
32
tests/bugs/step/bug33317
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
puts "========================"
|
||||||
|
puts "0033317: Data Exchange, Step Export - Ignoring color attached to the reference shape label"
|
||||||
|
puts "========================"
|
||||||
|
|
||||||
|
pload OCAF
|
||||||
|
|
||||||
|
Close D -silent
|
||||||
|
Close D1 -silent
|
||||||
|
|
||||||
|
set TempFilename ${imagedir}/${casename}_temp.stp
|
||||||
|
|
||||||
|
# Open document
|
||||||
|
XOpen [locate_data_file bug33317_solids_7_7_0.xml] D
|
||||||
|
|
||||||
|
# Get colors
|
||||||
|
set colors_old [XGetShapeColor D 0:1:1:1 generic]
|
||||||
|
|
||||||
|
# Write to STEP
|
||||||
|
WriteStep D ${TempFilename}
|
||||||
|
|
||||||
|
# Read and check
|
||||||
|
ReadStep D1 ${TempFilename}
|
||||||
|
|
||||||
|
set colors_new [XGetShapeColor D1 0:1:1:1:1 generic]
|
||||||
|
if { [string equal ${colors_new} ${colors_old}] == -1 } {
|
||||||
|
puts "ERROR: OCC33317 is reproduced while STEP export."
|
||||||
|
}
|
||||||
|
|
||||||
|
# Clear temp file
|
||||||
|
file delete -force $TempFilename
|
||||||
|
Close D
|
||||||
|
Close D1
|
@@ -1,5 +1,4 @@
|
|||||||
puts "TODO OCC24156 MacOS: Error: unsupported locale specification"
|
puts "TODO OCC24156 MacOS: Error: unsupported locale specification"
|
||||||
puts "TODO CR33225 Linux: Error: unsupported locale specification"
|
|
||||||
|
|
||||||
# Test for issue #22898 and other functionality that can be affected by locale.
|
# Test for issue #22898 and other functionality that can be affected by locale.
|
||||||
# Just run multiple conversions of the shape to and from different formats and
|
# Just run multiple conversions of the shape to and from different formats and
|
||||||
|
16
tests/bugs/xde/bug30828
Normal file
16
tests/bugs/xde/bug30828
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
puts "======="
|
||||||
|
puts "0030828: Data Exchange - The commands getting shapes from XCAF document should be available in C++"
|
||||||
|
puts "======="
|
||||||
|
|
||||||
|
pload OCAF
|
||||||
|
XNewDoc D
|
||||||
|
box b1 10 10 10
|
||||||
|
XAddShape D b1 1
|
||||||
|
XGetOneShape b D
|
||||||
|
checknbshapes b -shape 34
|
||||||
|
box b2 10 10 10
|
||||||
|
ttranslate b2 20 0 0
|
||||||
|
XAddShape D b2 1
|
||||||
|
XGetOneShape c D
|
||||||
|
checknbshapes c -shape 69 -compound 1
|
||||||
|
Close D -silent
|
16
tests/de_mesh/gltf_write/010
Normal file
16
tests/de_mesh/gltf_write/010
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||||
|
puts "Test case exporting model into glb (binary glTF) file."
|
||||||
|
puts "========"
|
||||||
|
|
||||||
|
Close D0 -silent
|
||||||
|
ReadGltf D0 [locate_data_file bug32867_010.glb]
|
||||||
|
|
||||||
|
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||||
|
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||||
|
|
||||||
|
WriteGltf D0 "$aGltfFile1" -draco on -mergefaces
|
||||||
|
WriteGltf D0 "$aGltfFile2" -draco on
|
||||||
|
|
||||||
|
ReadGltf D1 "$aGltfFile1"
|
||||||
|
ReadGltf D "$aGltfFile2"
|
16
tests/de_mesh/gltf_write/Diamond
Normal file
16
tests/de_mesh/gltf_write/Diamond
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||||
|
puts "Test case exporting model into glb (binary glTF) file."
|
||||||
|
puts "========"
|
||||||
|
|
||||||
|
Close D0 -silent
|
||||||
|
ReadGltf D0 [locate_data_file bug32867_Diamond.glb]
|
||||||
|
|
||||||
|
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||||
|
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||||
|
|
||||||
|
WriteGltf D0 "$aGltfFile1" -draco on
|
||||||
|
WriteGltf D0 "$aGltfFile2" -draco on -mergefaces
|
||||||
|
|
||||||
|
ReadGltf D1 "$aGltfFile1"
|
||||||
|
ReadGltf D "$aGltfFile2"
|
18
tests/de_mesh/gltf_write/as1draco
Normal file
18
tests/de_mesh/gltf_write/as1draco
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||||
|
puts "Test case exporting model into glb (binary glTF) file."
|
||||||
|
puts "========"
|
||||||
|
|
||||||
|
Close D0 -silent
|
||||||
|
ReadStep D0 [locate_data_file as1-oc-214-mat.stp]
|
||||||
|
XGetOneShape ss D0
|
||||||
|
incmesh ss 1.0
|
||||||
|
|
||||||
|
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||||
|
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||||
|
|
||||||
|
WriteGltf D0 "$aGltfFile1" -draco on
|
||||||
|
WriteGltf D0 "$aGltfFile2" -draco on -mergefaces
|
||||||
|
|
||||||
|
ReadGltf D1 "$aGltfFile1"
|
||||||
|
ReadGltf D "$aGltfFile2"
|
16
tests/de_mesh/gltf_write/bearing
Normal file
16
tests/de_mesh/gltf_write/bearing
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||||
|
puts "Test case exporting model into glb (binary glTF) file."
|
||||||
|
puts "========"
|
||||||
|
|
||||||
|
restore [locate_data_file bearing.brep] b
|
||||||
|
incmesh b 0.1
|
||||||
|
|
||||||
|
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||||
|
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||||
|
|
||||||
|
WriteGltf b "$aGltfFile1" -draco on
|
||||||
|
WriteGltf b "$aGltfFile2" -draco on -mergefaces
|
||||||
|
|
||||||
|
ReadGltf D0 "$aGltfFile1"
|
||||||
|
ReadGltf D "$aGltfFile2"
|
16
tests/de_mesh/gltf_write/bull
Normal file
16
tests/de_mesh/gltf_write/bull
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||||
|
puts "Test case exporting model into glb (binary glTF) file."
|
||||||
|
puts "========"
|
||||||
|
|
||||||
|
Close D0 -silent
|
||||||
|
ReadGltf D0 [locate_data_file bug32867_bull.glb]
|
||||||
|
|
||||||
|
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||||
|
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||||
|
|
||||||
|
WriteGltf D0 "$aGltfFile1" -draco on
|
||||||
|
WriteGltf D0 "$aGltfFile2" -draco on -mergefaces
|
||||||
|
|
||||||
|
ReadGltf D1 "$aGltfFile1"
|
||||||
|
ReadGltf D "$aGltfFile2"
|
13
tests/de_mesh/gltf_write/bull_parallel
Normal file
13
tests/de_mesh/gltf_write/bull_parallel
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||||
|
puts "Test case exporting model into glb (binary glTF) file."
|
||||||
|
puts "========"
|
||||||
|
|
||||||
|
Close D0 -silent
|
||||||
|
ReadGltf D0 [locate_data_file bug32867_bull.glb]
|
||||||
|
|
||||||
|
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||||
|
|
||||||
|
WriteGltf D0 "$aGltfFile1" -draco on -parallel
|
||||||
|
|
||||||
|
ReadGltf D "$aGltfFile1"
|
18
tests/de_mesh/gltf_write/screw
Normal file
18
tests/de_mesh/gltf_write/screw
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||||
|
puts "Test case exporting model into glb (binary glTF) file."
|
||||||
|
puts "========"
|
||||||
|
|
||||||
|
Close D0 -silent
|
||||||
|
ReadStep D0 [locate_data_file screw.step]
|
||||||
|
XGetOneShape ss D0
|
||||||
|
incmesh ss 1.0
|
||||||
|
|
||||||
|
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||||
|
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||||
|
|
||||||
|
WriteGltf D0 "$aGltfFile1" -draco on -mergefaces
|
||||||
|
WriteGltf D0 "$aGltfFile2" -draco on
|
||||||
|
|
||||||
|
ReadGltf D1 "$aGltfFile1"
|
||||||
|
ReadGltf D "$aGltfFile2"
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user