mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0025765: Coding rules - clean up code from obsolete macro checks
Unused code paths (including definition of these macros and meaningless comments) were eliminated.
This commit is contained in:
@@ -14,9 +14,6 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
|
||||
-- the restricted NameOfColor.
|
||||
|
||||
class Axis from AIS inherits InteractiveObject from AIS
|
||||
|
||||
---Purpose: Locates the x, y and z axes in an Interactive Object.
|
||||
|
@@ -14,8 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||
|
||||
#include <AIS_Axis.ixx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||
// if any in all dimensions.
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <AIS_Chamf2dDimension.ixx>
|
||||
@@ -99,11 +96,7 @@ AIS_Chamf2dDimension::AIS_Chamf2dDimension(const TopoDS_Shape& aFShape,
|
||||
myText = aText;
|
||||
myPosition = aPosition;
|
||||
mySymbolPrs = aSymbolPrs;
|
||||
#ifdef BUC60915
|
||||
SetArrowSize( anArrowSize );
|
||||
#else
|
||||
myArrowSize = anArrowSize;
|
||||
#endif
|
||||
myAutomaticPosition = Standard_False;
|
||||
}
|
||||
|
||||
@@ -197,9 +190,7 @@ void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
//determiner la taille de la fleche
|
||||
//-------------------------------------------------
|
||||
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined ) {
|
||||
#endif
|
||||
Standard_Real arrsize = myArrowSize;
|
||||
if ( (myVal/4) < arrsize)
|
||||
arrsize = myVal/4;
|
||||
@@ -207,13 +198,9 @@ void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
arrsize = 30.;
|
||||
else if (arrsize < 8.)
|
||||
arrsize = 8.;
|
||||
#ifdef BUC60915
|
||||
myArrowSize = arrsize;
|
||||
}
|
||||
arr->SetLength(myArrowSize);
|
||||
#else
|
||||
arr->SetLength(arrsize);
|
||||
#endif
|
||||
|
||||
//Calcul de la presentation
|
||||
DsgPrs_Chamf2dPresentation::Add(aPresentation,
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||
// if any in all dimensions.
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <AIS_Chamf3dDimension.ixx>
|
||||
@@ -95,11 +92,7 @@ AIS_Chamf3dDimension::AIS_Chamf3dDimension(const TopoDS_Shape& aFShape,
|
||||
myText = aText;
|
||||
myPosition = aPosition;
|
||||
mySymbolPrs = aSymbolPrs;
|
||||
#ifdef BUC60915
|
||||
SetArrowSize( anArrowSize );
|
||||
#else
|
||||
myArrowSize = anArrowSize;
|
||||
#endif
|
||||
myAutomaticPosition = Standard_False;
|
||||
}
|
||||
|
||||
@@ -172,9 +165,7 @@ void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
//Calcul de la boite englobante du component pour
|
||||
//determiner la taille de la fleche
|
||||
//-------------------------------------------------
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined ) {
|
||||
#endif
|
||||
Standard_Real arrsize = myArrowSize;
|
||||
if ( (myVal/4) < arrsize)
|
||||
arrsize = myVal/4;
|
||||
@@ -182,13 +173,9 @@ void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
arrsize = 30.;
|
||||
else if (arrsize < 8.)
|
||||
arrsize = 8.;
|
||||
#ifdef BUC60915
|
||||
myArrowSize = arrsize;
|
||||
}
|
||||
arr->SetLength(myArrowSize);
|
||||
#else
|
||||
arr->SetLength(arrsize);
|
||||
#endif
|
||||
|
||||
//Calcul de la presentation
|
||||
DsgPrs_Chamf2dPresentation::Add(aPresentation,
|
||||
|
@@ -14,9 +14,6 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
|
||||
-- the restricted NameOfColor.
|
||||
|
||||
class Circle from AIS inherits InteractiveObject from AIS
|
||||
|
||||
---Purpose: Constructs circle datums to be used in construction of
|
||||
|
@@ -14,8 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||
|
||||
#include <AIS_Circle.ixx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||
// if any in all dimensions.
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <AIS_EqualRadiusRelation.ixx>
|
||||
@@ -131,9 +128,7 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined )
|
||||
#endif
|
||||
myArrowSize = (Min(myFirstCenter.Distance(myFirstPoint),
|
||||
mySecondCenter.Distance(mySecondPoint)))*0.05;
|
||||
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||
// if any in all dimensions.
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <AIS_FixRelation.ixx>
|
||||
@@ -110,11 +107,7 @@ AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape,
|
||||
myFShape = aShape;
|
||||
myPlane = aPlane;
|
||||
myPosition = aPosition;
|
||||
#ifdef BUC60915
|
||||
SetArrowSize( anArrowSize );
|
||||
#else
|
||||
myArrowSize = anArrowSize;
|
||||
#endif
|
||||
myAutomaticPosition = Standard_False;
|
||||
}
|
||||
|
||||
@@ -147,11 +140,7 @@ AIS_FixRelation::AIS_FixRelation(
|
||||
myFShape = aShape;
|
||||
myPlane = aPlane;
|
||||
myPosition = aPosition;
|
||||
#ifdef BUC60915
|
||||
SetArrowSize( anArrowSize );
|
||||
#else
|
||||
myArrowSize = anArrowSize;
|
||||
#endif
|
||||
myAutomaticPosition = Standard_False;
|
||||
}
|
||||
|
||||
@@ -200,9 +189,7 @@ void AIS_FixRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
|
||||
|
||||
// calculate presentation
|
||||
// definition of the symbol size
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined )
|
||||
#endif
|
||||
myArrowSize = 5.;
|
||||
|
||||
//creation of the presentation
|
||||
|
@@ -14,9 +14,6 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
|
||||
-- the restricted NameOfColor.
|
||||
|
||||
class GraphicTool from AIS
|
||||
|
||||
---Purpose:
|
||||
|
@@ -14,10 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//GER61351 //GG_171199 Enable to get an object RGB color instead a restricted object NameOfColor.
|
||||
|
||||
|
||||
|
||||
#include <AIS_GraphicTool.ixx>
|
||||
|
||||
|
||||
|
@@ -18,20 +18,8 @@
|
||||
-- rob : Dec 17 1997 -> Update Method Added + Use in Deviation Angle...
|
||||
-- rob : Feb 05 1998 -> UpdateOnlySelection, UpdateOnlyPrs
|
||||
-- Apr 02 1998 -> Select Methods has been added a boolean updateviewer.
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible i
|
||||
-- Quantity_Color instead the restricted NameOfColor.
|
||||
-- Add SetCurrentFacingModel() methods
|
||||
-- GG : IMP140200 Add SetSelectedAspect() method
|
||||
-- GG : 25/05/00 BUC60688 Add SetSensitivity() methods
|
||||
-- VSV : 22/05/01 Add Selection by polygon
|
||||
-- SAV : Add DisplayFromCollector() method
|
||||
-- ZSV : IMP160701 Add InitDetected(),MoreDetected(),NextDetected(),
|
||||
-- DetectedCurrentShape(),DetectedCurrentObject()
|
||||
-- methods
|
||||
-- GG : IMP051001 Add SetZDetection() and ZDetection() methods
|
||||
-- SAV : OCC172 : Delete() redefined to remove selection objects from
|
||||
-- the static map.
|
||||
-- SAN : OCC4895 22/03/04 High-level interface for controlling polygon offsets
|
||||
-- SLN : SetToHilightSelected method added
|
||||
|
||||
|
||||
|
@@ -14,17 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define UKI60826 //GG_161199 Use the requested selection color instead of default
|
||||
|
||||
#define IMP280200 //GG Don't returns a NULL shape in SelectedShape()
|
||||
// method when the current selected is a shape !
|
||||
|
||||
#define BUC60814 //GG_300101 Idem UKI60826
|
||||
|
||||
#define OCC138 //VTN Avoding infinit loop in AddOrRemoveCurrentObject method.
|
||||
|
||||
#define OCC9657
|
||||
|
||||
#include <AIS_InteractiveContext.jxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <AIS_Selection.hxx>
|
||||
@@ -50,10 +39,8 @@
|
||||
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
|
||||
#ifdef OCC9657
|
||||
#include <AIS_MapOfInteractive.hxx>
|
||||
#include <AIS_MapIteratorOfMapOfInteractive.hxx>
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : MoveTo
|
||||
@@ -531,11 +518,7 @@ void AIS_InteractiveContext::SetCurrentObject(const Handle(AIS_InteractiveObject
|
||||
Standard_Boolean HasHiCol;
|
||||
if(IsHilighted(anIObj,HasHiCol,HiCol)){
|
||||
if(HasHiCol && HiCol!= mySelectionColor) {
|
||||
#ifdef UKI60826
|
||||
HilightWithColor(anIObj,mySelectionColor,updateviewer);
|
||||
#else
|
||||
Hilight(anIObj,updateviewer);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -568,19 +551,11 @@ void AIS_InteractiveContext::SetCurrentObject(const Handle(AIS_InteractiveObject
|
||||
Standard_Boolean HasHiCol;
|
||||
if(IsHilighted(anIObj,HasHiCol,HiCol)){
|
||||
if(HasHiCol && HiCol!= mySelectionColor) {
|
||||
#ifdef UKI60826
|
||||
HilightWithColor(anIObj,mySelectionColor,Standard_False);
|
||||
#else
|
||||
Hilight(anIObj,Standard_False);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else{
|
||||
#ifdef UKI60826
|
||||
HilightWithColor(anIObj,mySelectionColor,Standard_False);
|
||||
#else
|
||||
Hilight(anIObj,Standard_False);
|
||||
#endif
|
||||
}
|
||||
if (updateviewer)
|
||||
UpdateCurrentViewer();
|
||||
@@ -613,11 +588,7 @@ AddOrRemoveCurrentObject(const Handle(AIS_InteractiveObject)& anIObj,
|
||||
Standard_Integer mod = (SelStat==AIS_SS_Added) ? 1 : 0;
|
||||
anIObj->State(mod);
|
||||
if(mod==1)
|
||||
#ifdef BUC60814
|
||||
HilightWithColor(anIObj,mySelectionColor,Standard_False);
|
||||
#else
|
||||
Hilight(anIObj,Standard_False);
|
||||
#endif
|
||||
else
|
||||
Unhilight(anIObj,Standard_False);
|
||||
|
||||
@@ -745,11 +716,7 @@ void AIS_InteractiveContext::HilightCurrents(const Standard_Boolean updateviewer
|
||||
while (sel->More()) {
|
||||
TR = sel->Value();
|
||||
IO = *((Handle(AIS_InteractiveObject)*)&TR);
|
||||
#ifdef BUC60814
|
||||
HilightWithColor(IO,mySelectionColor,Standard_False);
|
||||
#else
|
||||
Hilight(IO,Standard_False);
|
||||
#endif
|
||||
sel->Next();
|
||||
}
|
||||
if(updateviewer)
|
||||
@@ -818,11 +785,7 @@ void AIS_InteractiveContext::HilightSelected(const Standard_Boolean updateviewer
|
||||
while (sel->More()) {
|
||||
TR = sel->Value();
|
||||
IO = *((Handle(AIS_InteractiveObject)*)&TR);
|
||||
#ifdef BUC60814
|
||||
HilightWithColor(IO,mySelectionColor,Standard_False);
|
||||
#else
|
||||
Hilight(IO,Standard_False);
|
||||
#endif
|
||||
sel->Next();
|
||||
}
|
||||
}
|
||||
@@ -1039,11 +1002,9 @@ void AIS_InteractiveContext::NextSelected()
|
||||
Standard_Boolean AIS_InteractiveContext::HasSelectedShape() const
|
||||
{
|
||||
if(!HasOpenedContext()) {
|
||||
#ifdef IMP280200
|
||||
Handle(AIS_Shape) shape =
|
||||
Handle(AIS_Shape)::DownCast(SelectedInteractive());
|
||||
if( !shape.IsNull() ) return Standard_True;
|
||||
#endif
|
||||
return Standard_False;
|
||||
}
|
||||
return myLocalContexts(myCurLocalIndex)->HasSelectedShape();
|
||||
|
@@ -14,8 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define IMP051001 //GG Adds SetZDetected() and ZDetected() methods
|
||||
|
||||
#include <AIS_InteractiveContext.jxx>
|
||||
|
||||
#include <AIS_LocalContext.hxx>
|
||||
@@ -888,7 +886,6 @@ void AIS_InteractiveContext::ResetOriginalState(const Standard_Boolean updatevie
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef IMP051001
|
||||
//=======================================================================
|
||||
//function : SetZDetection
|
||||
//purpose :
|
||||
@@ -906,4 +903,3 @@ Standard_Boolean AIS_InteractiveContext::ZDetection() const
|
||||
{
|
||||
return myZDetectionFlag;
|
||||
}
|
||||
#endif
|
||||
|
@@ -14,14 +14,6 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible
|
||||
-- Quantity_Color instead the restricted NameOfColor.
|
||||
-- Add SetCurrentFacingModel() methods
|
||||
-- GG : IMP140100 Add HasPresentation() and Presentation() methods
|
||||
-- Add SetAspect() method
|
||||
-- SAN : OCC4895 22/03/04 High-level interface for controlling polygon offsets
|
||||
|
||||
|
||||
deferred class InteractiveObject from AIS inherits SelectableObject from SelectMgr
|
||||
|
||||
---Purpose:
|
||||
@@ -607,7 +599,6 @@ fields
|
||||
|
||||
myDrawer : Drawer from AIS is protected ;
|
||||
myTransparency : Real from Standard is protected;
|
||||
-- GER61351 myOwnColor : NameOfColor from Quantity is protected;
|
||||
myOwnColor : Color from Quantity is protected;
|
||||
myOwnMaterial : NameOfMaterial from Graphic3d is protected;
|
||||
---myOwnMaterial : NameOfPhysicalMaterial from Graphic3d is protected;
|
||||
|
@@ -16,18 +16,6 @@
|
||||
|
||||
// Modified : 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
|
||||
|
||||
#define BUC60577 //GG_101099 Enable to compute correctly
|
||||
// transparency with more than one object in the view.
|
||||
|
||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
||||
// instead a restricted object NameOfColor.
|
||||
// Add SetCurrentFacingModel() method
|
||||
|
||||
#define BUC60632 //GG 15/03/00 Add protection on SetDisplayMode()
|
||||
// method, compute only authorized presentation.
|
||||
|
||||
#define OCC708 //SAV unsetting transformation correctly
|
||||
|
||||
#include <AIS_InteractiveObject.ixx>
|
||||
|
||||
#include <Aspect_PolygonOffsetMode.hxx>
|
||||
@@ -76,9 +64,7 @@ mystate(0)
|
||||
{
|
||||
Handle (AIS_InteractiveContext) Bid;
|
||||
myCTXPtr = Bid.operator->();
|
||||
#ifdef GER61351
|
||||
SetCurrentFacingModel();
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -208,9 +194,7 @@ void AIS_InteractiveObject::ClearUsers()
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetDisplayMode(const Standard_Integer aMode)
|
||||
{
|
||||
#ifdef BUC60632
|
||||
if( AcceptDisplayMode(aMode) )
|
||||
#endif
|
||||
myDisplayMode = aMode;
|
||||
}
|
||||
|
||||
@@ -230,7 +214,6 @@ void AIS_InteractiveObject::SetSelectionMode(const Standard_Integer aMode)
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
#ifdef GER61351
|
||||
void AIS_InteractiveObject::SetCurrentFacingModel(const Aspect_TypeOfFacingModel aModel) {
|
||||
myCurrentFacingModel = aModel;
|
||||
}
|
||||
@@ -243,7 +226,6 @@ void AIS_InteractiveObject::SetCurrentFacingModel(const Aspect_TypeOfFacingModel
|
||||
Aspect_TypeOfFacingModel AIS_InteractiveObject::CurrentFacingModel() const {
|
||||
return myCurrentFacingModel;
|
||||
}
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
@@ -251,7 +233,6 @@ Aspect_TypeOfFacingModel AIS_InteractiveObject::CurrentFacingModel() const {
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveObject::SetColor(const Quantity_NameOfColor aColor)
|
||||
#ifdef GER61351
|
||||
{
|
||||
SetColor(Quantity_Color(aColor));
|
||||
}
|
||||
@@ -262,7 +243,6 @@ void AIS_InteractiveObject::SetColor(const Quantity_NameOfColor aColor)
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveObject::SetColor(const Quantity_Color &aColor)
|
||||
#endif
|
||||
{
|
||||
myOwnColor = aColor;
|
||||
hasOwnColor = Standard_True;
|
||||
@@ -313,9 +293,6 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
|
||||
myDrawer->ShadingAspect()->SetMaterial(aName);
|
||||
#ifndef BUC60577 //???
|
||||
myDrawer->ShadingAspect()->SetColor(AIS_GraphicTool::GetInteriorColor(myDrawer->Link()));
|
||||
#endif
|
||||
}
|
||||
myOwnMaterial = aName;
|
||||
hasOwnMaterial = Standard_True;
|
||||
@@ -327,11 +304,7 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
|
||||
|
||||
void AIS_InteractiveObject::SetMaterial(const Graphic3d_MaterialAspect& aMat)
|
||||
{
|
||||
#ifdef BUC60577
|
||||
if( HasColor() || IsTransparent() || HasMaterial() )
|
||||
#else
|
||||
if(hasOwnColor ||(myTransparency==0.0) || hasOwnMaterial )
|
||||
#endif
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
}
|
||||
@@ -349,7 +322,6 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_MaterialAspect& aMat)
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetMaterial()
|
||||
{
|
||||
#ifdef BUC60577
|
||||
if( !HasMaterial() ) return;
|
||||
if( HasColor() || IsTransparent()) {
|
||||
myDrawer->ShadingAspect()->SetMaterial(
|
||||
@@ -357,13 +329,6 @@ void AIS_InteractiveObject::UnsetMaterial()
|
||||
if( HasColor() ) SetColor(myOwnColor);
|
||||
if( IsTransparent() ) SetTransparency(myTransparency);
|
||||
}
|
||||
#else
|
||||
if(!hasOwnMaterial) return;
|
||||
if(hasOwnColor ||(myTransparency==0.0))
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
|
||||
}
|
||||
#endif
|
||||
else{
|
||||
Handle(Prs3d_ShadingAspect) SA;
|
||||
myDrawer->SetShadingAspect(SA);
|
||||
@@ -378,7 +343,6 @@ void AIS_InteractiveObject::UnsetMaterial()
|
||||
void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
|
||||
{
|
||||
|
||||
#ifdef BUC60577 // Back & Front material can be different !
|
||||
|
||||
if(!HasColor() && !IsTransparent() && !HasMaterial() ) {
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
@@ -390,34 +354,6 @@ void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
|
||||
FMat.SetTransparency(aValue); BMat.SetTransparency(aValue);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
|
||||
#else
|
||||
if(aValue<0.0 || aValue>1.0) return;
|
||||
|
||||
if(aValue<=0.05)
|
||||
{
|
||||
UnsetTransparency();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(hasOwnColor || hasOwnMaterial || myTransparency> 0.0)
|
||||
{
|
||||
Graphic3d_MaterialAspect Mat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Mat.SetTransparency(aValue);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(Mat);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(Mat);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
if(!myDrawer->Link().IsNull())
|
||||
myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
|
||||
Graphic3d_MaterialAspect Mat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Mat.SetTransparency(aValue);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(Mat);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(Mat);
|
||||
}
|
||||
#endif
|
||||
myTransparency = aValue;
|
||||
}
|
||||
|
||||
@@ -427,7 +363,6 @@ void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetTransparency()
|
||||
{
|
||||
#ifdef BUC60577 // Back & Front material can be different !
|
||||
if(HasColor() || HasMaterial() )
|
||||
{
|
||||
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
@@ -436,16 +371,6 @@ void AIS_InteractiveObject::UnsetTransparency()
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
|
||||
}
|
||||
#else
|
||||
if(hasOwnColor || hasOwnMaterial )
|
||||
{
|
||||
Graphic3d_MaterialAspect Mat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Mat.SetTransparency(0.0);
|
||||
// myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(Mat);
|
||||
// myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(Mat);
|
||||
myDrawer->ShadingAspect()->SetMaterial(Mat);
|
||||
}
|
||||
#endif
|
||||
else{
|
||||
Handle (Prs3d_ShadingAspect) SA;
|
||||
myDrawer->SetShadingAspect(SA);
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||
|
||||
|
||||
inline Standard_Boolean AIS_InteractiveObject::AcceptShapeDecomposition() const
|
||||
{return Standard_False;}
|
||||
|
||||
|
@@ -14,9 +14,6 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
|
||||
-- the restricted NameOfColor.
|
||||
|
||||
class Line from AIS inherits InteractiveObject from AIS
|
||||
|
||||
---Purpose: Constructs line datums to be used in construction of
|
||||
|
@@ -14,8 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||
|
||||
#include <AIS_Line.ixx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
@@ -21,13 +21,6 @@
|
||||
-- Modifications in Management of hilight of detected entities
|
||||
-- VTN 23/11/99 BUC60614 Avoid to crash because
|
||||
-- myStdFilters array is too short.
|
||||
-- GG : BUC60688 25/05/00 Add SetSensitivity() methods
|
||||
-- GG : IMP150501 Remove oboslete method DragTo
|
||||
-- (See AIS_InteractiveContext)
|
||||
-- ZSV : IMP160701 Add InitDetected(),MoreDetected(),NextDetected(),
|
||||
-- DetectedCurrentShape(),DetectedCurrentObject()
|
||||
-- methods
|
||||
|
||||
|
||||
class LocalContext from AIS inherits TShared from MMgt
|
||||
|
||||
|
@@ -16,20 +16,6 @@
|
||||
|
||||
//Modified by ROB : Traque des UpdateConversion intempestifs.
|
||||
|
||||
#define BUC60688 //GG 25/05/00 Add SetSensitivity() methods.
|
||||
|
||||
#define BUC60722 //GG_040900 Disable detection on an unviewable object
|
||||
|
||||
#define IMP160701 //SZV Add InitDetected(),MoreDetected(),NextDetected(),
|
||||
// DetectedCurrentShape(),DetectedCurrentObject()
|
||||
// methods
|
||||
|
||||
#define ALE70590 //GG Avoid raise especially under W2000-SP2
|
||||
// when opening many local context due to a
|
||||
// system error in the selection name computation routine.
|
||||
// Many thanks to Philippe CARRET for the helpfull he has
|
||||
// give to accelerate the resolution of this problem.
|
||||
|
||||
#include <AIS_LocalContext.ixx>
|
||||
#include <SelectMgr_OrFilter.hxx>
|
||||
#include <SelectMgr_CompositionFilter.hxx>
|
||||
@@ -52,35 +38,15 @@
|
||||
#include <V3d_View.hxx>
|
||||
#include <Visual3d_View.hxx>
|
||||
|
||||
#ifdef ALE70590
|
||||
#include <stdio.h>
|
||||
#else
|
||||
#include <Standard_SStream.hxx>
|
||||
#endif
|
||||
|
||||
static TCollection_AsciiString AIS_Local_SelName(const Standard_Address address,
|
||||
const Standard_Integer anIndex)
|
||||
{
|
||||
// TCollection_AsciiString SelName;
|
||||
#ifdef ALE70590
|
||||
char string[100];
|
||||
sprintf(string,"%p_%d", address, anIndex); // works under any system
|
||||
TCollection_AsciiString SelName(string);
|
||||
#else
|
||||
Standard_SStream stream;
|
||||
stream<<address; // something is wrong here using the SStream because
|
||||
// the following access to rdbuf crash for an unknown reason
|
||||
// especially under W2000 with SP2 and sometime under WNT and W98.
|
||||
// NOTE that stream is not ended by a NULL char and it's probably
|
||||
// one of the reasons why this crash.
|
||||
// In any case the resulting ascii string give a wrong and random
|
||||
// name under WINDOWS !
|
||||
TCollection_AsciiString SelName(stream.rdbuf()->str());
|
||||
// SelName = TCollection_AsciiString("AIS_Local_");
|
||||
TCollection_AsciiString theind(anIndex);
|
||||
SelName += "_";
|
||||
SelName += theind;
|
||||
#endif
|
||||
return SelName;
|
||||
}
|
||||
|
||||
@@ -109,10 +75,9 @@ myFilters(new SelectMgr_OrFilter()),
|
||||
myAutoHilight(Standard_True),
|
||||
mylastindex(0),
|
||||
mylastgood(0),
|
||||
myCurDetected(0)
|
||||
#ifdef IMP160701
|
||||
,myAISCurDetected(0)
|
||||
#endif
|
||||
myCurDetected(0),
|
||||
myAISCurDetected(0)
|
||||
|
||||
{
|
||||
// bind self to AIS_InteractiveContext::myLocalContexts. Further, the
|
||||
// constructor executes logic that implies that the context is already
|
||||
|
@@ -18,58 +18,6 @@
|
||||
// - use of optimisation in SelectMgr_ViewerSelector
|
||||
// -> Best management in detected entities...
|
||||
|
||||
#define BUC60569 //GG_051199 Enable to select the local context
|
||||
// in any case and especially in multi selection mode.
|
||||
// Note that right now when an hilighted owner is selected
|
||||
// this owner is unhilighted,this permits to see the selection!
|
||||
// Principle : an owner can have 3 state :
|
||||
// 1 : The owner is selected and no more highlightable
|
||||
// 0 : The owner is NOT selected
|
||||
// -1: The owner is selected but stay highlightable (NEW)
|
||||
|
||||
// IMP230600 //GG Add protection on selection methodes
|
||||
// when nothing is selected
|
||||
|
||||
#define BUC60726 //GG_040900 When nothing is detected,
|
||||
// Clear the last temporary stuff in any case
|
||||
|
||||
#define BUC60765 //GG_121000 Avoid to raise when the same selection
|
||||
// is attached to several local context.
|
||||
|
||||
#define BUC60771 //GG_261000 Avoid to crash after closing a view
|
||||
// containing a selected entity and creating a new one.
|
||||
|
||||
#define BUC60774 //GG_261000 Returns right select status on
|
||||
// bounding-box selection type.
|
||||
|
||||
#define BUC60818 //GG_300101 Enable detection even if
|
||||
// SetAutomaticHilight(FALSE) has been used.
|
||||
|
||||
#define IMP300101 //GG Enable to use polygon highlighting
|
||||
|
||||
#define BUC60876 //GG_050401 Clear selection always even
|
||||
// if the current highlight mode is not 0.
|
||||
|
||||
#define BUC60953 //SAV_060701 For Select optimization. Selection by rectangle case.
|
||||
// for single selection no optimization done.
|
||||
|
||||
#define IMP120701 //SZV made a shape valid for selection
|
||||
// when required.
|
||||
|
||||
#define IMP160701 //SZV Add InitDetected(),MoreDetected(),NextDetected(),
|
||||
// DetectedCurrentShape(),DetectedCurrentObject()
|
||||
// methods
|
||||
|
||||
#define OCC138 //VTN Avoding infinit loop in AddOrRemoveSelected method.
|
||||
|
||||
#define OCC189 //SAV: 18/03/02 AIS_Selection::Objects() returns ListOfTransient
|
||||
// instead of array.
|
||||
|
||||
#define USE_MAP //san : 18/04/03 USE_MAP - additional datamap is used to speed up access
|
||||
//to certain owners in AIS_Selection::myresult list
|
||||
|
||||
#define OCC9026 //AEL Performance optimization of the FindSelectedOwnerFromShape() method.
|
||||
|
||||
#include <AIS_LocalContext.jxx>
|
||||
#include <StdSelect_BRepOwner.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
@@ -88,9 +36,7 @@
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <NCollection_Map.hxx>
|
||||
|
||||
#ifdef OCC9026
|
||||
#include <SelectMgr_DataMapIteratorOfDataMapOfIntegerSensitive.hxx>
|
||||
#endif
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <SelectMgr_SequenceOfOwner.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
@@ -98,10 +44,7 @@
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <AIS_Selection.hxx>
|
||||
#include <Aspect_Grid.hxx>
|
||||
#ifdef IMP120701
|
||||
#include <AIS_Shape.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
static Standard_Integer GetHiMod(const Handle(AIS_InteractiveObject)& IO)
|
||||
{
|
||||
@@ -397,12 +340,10 @@ AIS_StatusOfPick AIS_LocalContext::ShiftSelect (const Standard_Boolean toUpdateV
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BUC60774
|
||||
Standard_Integer NS = AIS_Selection::Extent();
|
||||
if( NS == 1 ) return AIS_SOP_OneSelected;
|
||||
else if( NS > 1 ) return AIS_SOP_SeveralSelected;
|
||||
return aSelNum == 0 ? AIS_SOP_NothingSelected : AIS_SOP_Removed;
|
||||
#endif
|
||||
}
|
||||
return AIS_SOP_Error;
|
||||
}
|
||||
@@ -568,9 +509,7 @@ void AIS_LocalContext::Unhilight (const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||
void AIS_LocalContext::HilightPicked(const Standard_Boolean updateviewer)
|
||||
{
|
||||
Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
|
||||
#ifdef BUC60765
|
||||
if( Sel.IsNull() ) return;
|
||||
#endif
|
||||
|
||||
typedef NCollection_DataMap <Handle(SelectMgr_SelectableObject), NCollection_Handle<SelectMgr_SequenceOfOwner> > SelectMgr_DataMapOfObjectOwners;
|
||||
SelectMgr_DataMapOfObjectOwners aMap;
|
||||
@@ -578,18 +517,11 @@ void AIS_LocalContext::HilightPicked(const Standard_Boolean updateviewer)
|
||||
Handle (PrsMgr_PresentationManager3d) PM = myMainPM;
|
||||
|
||||
// to avoid problems when there is a loop searching for selected objects...
|
||||
#if !defined OCC189 && !defined USE_MAP
|
||||
const TColStd_Array1OfTransient& Obj = Sel->Objects()->Array1();
|
||||
for(Standard_Integer i =Obj.Lower();i<=Sel->NbStored();i++)
|
||||
{
|
||||
const Handle(Standard_Transient)& Tr = Obj(i);
|
||||
#else
|
||||
const AIS_NListTransient& Obj = Sel->Objects();
|
||||
AIS_NListTransient::Iterator anIter( Obj );
|
||||
for(; anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(Standard_Transient)& Tr = anIter.Value();
|
||||
#endif
|
||||
if(!Tr.IsNull()){
|
||||
const Handle(SelectMgr_EntityOwner)& Ownr =
|
||||
*((const Handle(SelectMgr_EntityOwner)*) &Tr);
|
||||
@@ -636,41 +568,26 @@ void AIS_LocalContext::UnhilightPicked (const Standard_Boolean updateviewer)
|
||||
myMainPM->ClearImmediateDraw();
|
||||
|
||||
Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
|
||||
#ifdef BUC60765
|
||||
if( Sel.IsNull() ) return;
|
||||
#endif
|
||||
Handle (PrsMgr_PresentationManager3d) PM = myMainPM;
|
||||
NCollection_Map<Handle(SelectMgr_SelectableObject)> anObjMap;
|
||||
|
||||
#if !defined OCC189 && !defined USE_MAP
|
||||
const TColStd_Array1OfTransient& Obj = Sel->Objects()->Array1();
|
||||
for(Standard_Integer i =Obj.Lower();i<=Sel->NbStored();i++){
|
||||
const Handle(Standard_Transient)& Tr = Obj(i);
|
||||
#else
|
||||
const AIS_NListTransient& Obj = Sel->Objects();
|
||||
AIS_NListTransient::Iterator anIter( Obj );
|
||||
for(; anIter.More(); anIter.Next()){
|
||||
const Handle(Standard_Transient)& Tr = anIter.Value();
|
||||
#endif
|
||||
if(!Tr.IsNull()){
|
||||
const Handle(SelectMgr_EntityOwner)& Ownr =
|
||||
*((const Handle(SelectMgr_EntityOwner)*) &Tr);
|
||||
Standard_Integer HM(0);
|
||||
if(Ownr->HasSelectable()){
|
||||
#ifdef BUC60876
|
||||
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
|
||||
Handle(AIS_InteractiveObject) IO = *((Handle(AIS_InteractiveObject)*)&SO);
|
||||
anObjMap.Add (IO);
|
||||
|
||||
HM = GetHiMod(IO);
|
||||
#endif
|
||||
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(Ownr);
|
||||
if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){
|
||||
#ifndef BUC60876
|
||||
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
|
||||
Handle(AIS_InteractiveObject) IO = *((Handle(AIS_InteractiveObject)*)&SO);
|
||||
HM = GetHiMod(IO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Ownr->Unhilight(PM,HM);
|
||||
@@ -903,16 +820,10 @@ void AIS_LocalContext::ClearSelected (const Standard_Boolean updateviewer)
|
||||
AIS_Selection::SetCurrentSelection(mySelName.ToCString());
|
||||
|
||||
Handle(AIS_Selection) Sel = AIS_Selection::CurrentSelection();
|
||||
#if !defined OCC189 && !defined USE_MAP
|
||||
const TColStd_Array1OfTransient& Obj = Sel->Objects()->Array1();
|
||||
for(Standard_Integer i =Obj.Lower();i<=Sel->NbStored();i++){
|
||||
const Handle(Standard_Transient)& Tr = Obj(i);
|
||||
#else
|
||||
const AIS_NListTransient& Obj = Sel->Objects();
|
||||
AIS_NListTransient::Iterator anIter( Obj );
|
||||
for(; anIter.More(); anIter.Next()){
|
||||
const Handle(Standard_Transient)& Tr = anIter.Value();
|
||||
#endif
|
||||
if(!Tr.IsNull())
|
||||
{
|
||||
(*((const Handle(SelectMgr_EntityOwner)*)&Tr))->SetSelected (Standard_False);
|
||||
@@ -1418,12 +1329,10 @@ Standard_Boolean AIS_LocalContext::IsShape(const Standard_Integer Index) const
|
||||
Standard_Boolean AIS_LocalContext::IsValidForSelection(const Handle(AIS_InteractiveObject)& anIObj) const
|
||||
{
|
||||
|
||||
#ifdef IMP120701
|
||||
// Shape was not transfered from AIS_Shape to EntityOwner
|
||||
Handle(AIS_Shape) shape = Handle(AIS_Shape)::DownCast(anIObj);
|
||||
if( !shape.IsNull() )
|
||||
return myFilters->IsOk(new StdSelect_BRepOwner(shape->Shape(),shape));
|
||||
#endif
|
||||
return myFilters->IsOk(new SelectMgr_EntityOwner(anIObj));
|
||||
}
|
||||
|
||||
@@ -1524,16 +1433,10 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromIO
|
||||
return EO;
|
||||
}
|
||||
Standard_Boolean found(Standard_False);
|
||||
#if !defined OCC189 && !defined USE_MAP
|
||||
const TColStd_Array1OfTransient& Obj = Sel->Objects()->Array1();
|
||||
for(Standard_Integer i =Obj.Lower();i<=Sel->NbStored();i++){
|
||||
const Handle(Standard_Transient)& Tr = Obj(i);
|
||||
#else
|
||||
const AIS_NListTransient& Obj = Sel->Objects();
|
||||
AIS_NListTransient::Iterator anIter( Obj );
|
||||
for(; anIter.More(); anIter.Next()){
|
||||
const Handle(Standard_Transient)& Tr = anIter.Value();
|
||||
#endif
|
||||
if(!Tr.IsNull()){
|
||||
EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
|
||||
if(EO->HasSelectable()){
|
||||
@@ -1557,11 +1460,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromIO
|
||||
//=======================================================================
|
||||
Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const TopoDS_Shape& sh) const
|
||||
{
|
||||
#ifdef OCC9026
|
||||
Handle(SelectMgr_EntityOwner) EO, bid;
|
||||
#else
|
||||
Handle(SelectMgr_EntityOwner) EO;
|
||||
#endif
|
||||
if (sh.IsNull()) return EO;
|
||||
|
||||
Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
|
||||
@@ -1574,7 +1473,6 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const
|
||||
|
||||
Standard_Boolean found(Standard_False);
|
||||
|
||||
#ifdef OCC9026
|
||||
if (!found) {
|
||||
SelectMgr_DataMapIteratorOfDataMapOfIntegerSensitive aSensitiveIt (myMainVS->Primitives());
|
||||
for (; aSensitiveIt.More(); aSensitiveIt.Next()) {
|
||||
@@ -1586,33 +1484,11 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#if !defined OCC189 && !defined USE_MAP
|
||||
const TColStd_Array1OfTransient& Obj = Sel->Objects()->Array1();
|
||||
for(Standard_Integer i =Obj.Lower();i<=Sel->NbStored();i++){
|
||||
const Handle(Standard_Transient)& Tr = Obj(i);
|
||||
#else
|
||||
const AIS_NListTransient& Obj = Sel->Objects();
|
||||
AIS_NListTransient::Iterator anIter( Obj );
|
||||
for(; anIter.More(); anIter.Next()){
|
||||
const Handle(Standard_Transient)& Tr = anIter.Value();
|
||||
#endif
|
||||
if(!Tr.IsNull()){
|
||||
|
||||
EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
|
||||
if(EO->HasShape())
|
||||
if ( EO->Shape() == sh)
|
||||
found =Standard_True;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(found) return EO;
|
||||
return bid;
|
||||
}
|
||||
|
||||
#ifdef IMP160701
|
||||
//=======================================================================
|
||||
//function : AIS_LocalContext::InitDetected
|
||||
//purpose :
|
||||
@@ -1665,4 +1541,3 @@ Handle(AIS_InteractiveObject) AIS_LocalContext::DetectedCurrentObject() const
|
||||
{
|
||||
return MoreDetected() ? myAISDetectedSeq(myAISCurDetected) : NULL;
|
||||
}
|
||||
#endif
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||
// if any in all dimensions.
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <AIS_MaxRadiusDimension.ixx>
|
||||
@@ -97,11 +94,7 @@ AIS_MaxRadiusDimension::AIS_MaxRadiusDimension(const TopoDS_Shape& aShape,
|
||||
mySymbolPrs = aSymbolPrs;
|
||||
myPosition = aPosition;
|
||||
myAutomaticPosition = Standard_False;
|
||||
#ifdef BUC60915
|
||||
SetArrowSize( anArrowSize );
|
||||
#else
|
||||
myArrowSize = anArrowSize;
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -167,19 +160,10 @@ void AIS_MaxRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aP
|
||||
Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect();
|
||||
|
||||
// size
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined ) {
|
||||
myArrowSize = Min(myArrowSize,myVal / 5.);
|
||||
}
|
||||
arr->SetLength(myArrowSize);
|
||||
#else
|
||||
if (myVal / 5. > myArrowSize) {
|
||||
arr->SetLength(myArrowSize);
|
||||
}
|
||||
else {
|
||||
arr->SetLength(myVal / 5.);
|
||||
}
|
||||
#endif
|
||||
|
||||
Standard_Real U;//,V;
|
||||
gp_Pnt curPos, Center;
|
||||
@@ -225,19 +209,10 @@ void AIS_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation
|
||||
Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect();
|
||||
|
||||
// size
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined ) {
|
||||
myArrowSize = Min(myArrowSize,myVal / 5.);
|
||||
}
|
||||
arr->SetLength(myArrowSize);
|
||||
#else
|
||||
if (myVal / 5. > myArrowSize) {
|
||||
arr->SetLength(myArrowSize);
|
||||
}
|
||||
else {
|
||||
arr->SetLength(myVal / 5.);
|
||||
}
|
||||
#endif
|
||||
|
||||
Standard_Real par;
|
||||
gp_Pnt curPos, Center;
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||
// if any in all dimensions.
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <AIS_MinRadiusDimension.ixx>
|
||||
@@ -99,11 +96,7 @@ AIS_MinRadiusDimension::AIS_MinRadiusDimension(const TopoDS_Shape& aShape,
|
||||
mySymbolPrs = aSymbolPrs;
|
||||
myPosition = aPosition;
|
||||
myAutomaticPosition = Standard_False;
|
||||
#ifdef BUC60915
|
||||
SetArrowSize( anArrowSize );
|
||||
#else
|
||||
myArrowSize = anArrowSize;
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -168,19 +161,10 @@ void AIS_MinRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aP
|
||||
Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect();
|
||||
|
||||
// size
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined ) {
|
||||
myArrowSize = Min(myArrowSize,myVal/5.);
|
||||
}
|
||||
arr->SetLength(myArrowSize);
|
||||
#else
|
||||
if (myVal/5. > myArrowSize) {
|
||||
arr->SetLength(myArrowSize);
|
||||
}
|
||||
else {
|
||||
arr->SetLength(myVal/5.);
|
||||
}
|
||||
#endif
|
||||
|
||||
Standard_Real U;//,V;
|
||||
gp_Pnt curPos, Center;
|
||||
@@ -227,19 +211,10 @@ void AIS_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation
|
||||
Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect();
|
||||
|
||||
// size
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined ) {
|
||||
myArrowSize = Min(myArrowSize,myVal/5.);
|
||||
}
|
||||
arr->SetLength(myArrowSize);
|
||||
#else
|
||||
if (myVal/5. > myArrowSize) {
|
||||
arr->SetLength(myArrowSize);
|
||||
}
|
||||
else {
|
||||
arr->SetLength(myVal/5.);
|
||||
}
|
||||
#endif
|
||||
|
||||
Standard_Real par;
|
||||
gp_Pnt curPos, Center;
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||
// if any in all dimensions.
|
||||
|
||||
#include <AIS_ParallelRelation.ixx>
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
@@ -91,11 +88,7 @@ AIS_ParallelRelation::AIS_ParallelRelation(const TopoDS_Shape& aFShape,
|
||||
mySShape = aSShape;
|
||||
myPlane = aPlane;
|
||||
myAutomaticPosition = Standard_False;
|
||||
#ifdef BUC60915
|
||||
SetArrowSize( anArrowSize );
|
||||
#else
|
||||
myArrowSize = anArrowSize;
|
||||
#endif
|
||||
myPosition = aPosition;
|
||||
mySymbolPrs = aSymbolPrs;
|
||||
}
|
||||
@@ -296,17 +289,13 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
|
||||
|
||||
myDirAttach = l1.Direction();
|
||||
// size
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined ) {
|
||||
#endif
|
||||
Standard_Real arrSize1 (myArrowSize), arrSize2 (myArrowSize);
|
||||
if (!isInfinite1) arrSize1 = ptat11.Distance(ptat12)/50.;
|
||||
if (!isInfinite2) arrSize2 = ptat21.Distance(ptat22)/50.;
|
||||
myArrowSize = Max(myArrowSize,Max(arrSize1,arrSize2));
|
||||
// myArrowSize = Min(myArrowSize,Min(arrSize1,arrSize2));
|
||||
#ifdef BUC60915
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( myAutomaticPosition )
|
||||
{
|
||||
|
@@ -14,8 +14,6 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
|
||||
-- the restricted NameOfColor.
|
||||
--Modified by rob Wed 11 feb 98 : add Size Methods
|
||||
|
||||
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
||||
// instead a restricted object NameOfColor.
|
||||
|
||||
#include <AIS_Plane.ixx>
|
||||
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
@@ -449,13 +446,11 @@ Standard_Boolean AIS_Plane::Size(Standard_Real& X,Standard_Real& Y) const
|
||||
|
||||
|
||||
void AIS_Plane::SetColor(const Quantity_NameOfColor aCol)
|
||||
#ifdef GER61351
|
||||
{
|
||||
SetColor(Quantity_Color(aCol));
|
||||
}
|
||||
|
||||
void AIS_Plane::SetColor(const Quantity_Color &aCol)
|
||||
#endif
|
||||
{
|
||||
// if the plane already has its proper size, there is an already created planeaspect
|
||||
// Standard_Boolean yenadeja = hasOwnColor || myHasOwnSize;
|
||||
|
@@ -14,13 +14,6 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
|
||||
-- the restricted NameOfColor.
|
||||
-- SAV : OCC218 06/03/02 : Added two fields and methods to be able to change
|
||||
-- axes labels.
|
||||
-- X/YAxis() returns AIS_Line instead of AIS_Axis
|
||||
-- (SAMTECH specific)
|
||||
|
||||
class PlaneTrihedron from AIS inherits InteractiveObject from AIS
|
||||
|
||||
---Purpose: To construct a selectable 2d axis system in a 3d
|
||||
|
@@ -14,18 +14,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||
|
||||
#define OCC218 //SAV using DsgPrs_XYZAxisPresentation to draw axes.
|
||||
// + X/YAxis() returns AIS_Line instead of AIS_Axis
|
||||
// + (-1) selection mode token into account
|
||||
// (SAMTECH specific)
|
||||
|
||||
#ifdef OCC218
|
||||
#include <DsgPrs_XYZAxisPresentation.hxx>
|
||||
#include <AIS_Line.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#endif
|
||||
|
||||
#include <AIS_PlaneTrihedron.ixx>
|
||||
|
||||
@@ -54,8 +49,6 @@
|
||||
|
||||
#include <Select3D_SensitiveFace.hxx>
|
||||
|
||||
#define OCC10
|
||||
|
||||
void ExtremityPoints(TColgp_Array1OfPnt& PP,const Handle(Geom_Plane)& myPlane,const Handle(Prs3d_Drawer)& myDrawer);
|
||||
|
||||
//=======================================================================
|
||||
@@ -79,10 +72,8 @@ AIS_PlaneTrihedron::AIS_PlaneTrihedron(const Handle(Geom_Plane)& aPlane)
|
||||
myShapes[1] = XAxis();
|
||||
myShapes[2] = YAxis();
|
||||
|
||||
#ifdef OCC218
|
||||
myXLabel = TCollection_AsciiString( "X" );
|
||||
myYLabel = TCollection_AsciiString( "Y" );
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -110,7 +101,6 @@ AIS_PlaneTrihedron::AIS_PlaneTrihedron(const Handle(Geom_Plane)& aPlane)
|
||||
//function : XAxis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
#ifdef OCC218
|
||||
Handle(AIS_Line) AIS_PlaneTrihedron::XAxis() const
|
||||
{
|
||||
Handle(Geom_Line) aGLine = new Geom_Line(myPlane->Pln().XAxis());
|
||||
@@ -118,21 +108,11 @@ Handle(AIS_Line) AIS_PlaneTrihedron::XAxis() const
|
||||
aLine->SetColor(Quantity_NOC_ROYALBLUE1);
|
||||
return aLine;
|
||||
}
|
||||
#else
|
||||
Handle(AIS_Axis) AIS_PlaneTrihedron::XAxis() const
|
||||
{
|
||||
Handle(Geom_Axis1Placement) anAx1 = new Geom_Axis1Placement(myPlane->Pln().XAxis());
|
||||
Handle(AIS_Axis) anAxis = new AIS_Axis (anAx1);
|
||||
anAxis->SetTypeOfAxis(AIS_TOAX_XAxis);
|
||||
return anAxis;
|
||||
}
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : YAxis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
#ifdef OCC218
|
||||
Handle(AIS_Line) AIS_PlaneTrihedron::YAxis() const
|
||||
{
|
||||
Handle(Geom_Line) aGLine = new Geom_Line(myPlane->Pln().YAxis());
|
||||
@@ -140,15 +120,6 @@ Handle(AIS_Line) AIS_PlaneTrihedron::YAxis() const
|
||||
aLine->SetColor(Quantity_NOC_ROYALBLUE1);
|
||||
return aLine;
|
||||
}
|
||||
#else
|
||||
Handle(AIS_Axis) AIS_PlaneTrihedron::YAxis() const
|
||||
{
|
||||
Handle(Geom_Axis1Placement) anAx1 = new Geom_Axis1Placement(myPlane->Pln().YAxis());
|
||||
Handle(AIS_Axis) anAxis = new AIS_Axis (anAx1);
|
||||
anAxis->SetTypeOfAxis(AIS_TOAX_YAxis);
|
||||
return anAxis;
|
||||
}
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : Position
|
||||
@@ -162,7 +133,6 @@ Handle(AIS_Point) AIS_PlaneTrihedron::Position() const
|
||||
return aPt;
|
||||
}
|
||||
|
||||
#ifdef OCC10
|
||||
void AIS_PlaneTrihedron::SetLength(const Standard_Real theLength) {
|
||||
myDrawer->DatumAspect()->SetAxisLength(theLength, theLength, theLength);
|
||||
SetToUpdate();
|
||||
@@ -171,7 +141,6 @@ void AIS_PlaneTrihedron::SetLength(const Standard_Real theLength) {
|
||||
Standard_Real AIS_PlaneTrihedron::GetLength() const {
|
||||
return myDrawer->DatumAspect()->FirstAxisLength();
|
||||
}
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : Compute
|
||||
@@ -183,9 +152,6 @@ void AIS_PlaneTrihedron::Compute(const Handle(PrsMgr_PresentationManager3d)&,
|
||||
{
|
||||
aPresentation->Clear();
|
||||
aPresentation->SetDisplayPriority(5);
|
||||
#ifndef OCC218
|
||||
DsgPrs_DatumPrs::Add(aPresentation,myPlane->Position().Ax2(),myDrawer);
|
||||
#else
|
||||
// drawing axis in X direction
|
||||
gp_Pnt first, last;
|
||||
Standard_Real value = myDrawer->DatumAspect()->FirstAxisLength();
|
||||
@@ -208,7 +174,6 @@ void AIS_PlaneTrihedron::Compute(const Handle(PrsMgr_PresentationManager3d)&,
|
||||
last.SetCoord( xo + x * value, yo + y * value, zo + z * value );
|
||||
DsgPrs_XYZAxisPresentation::Add( aPresentation, myDrawer->DatumAspect()->FirstAxisAspect(), myDrawer->ArrowAspect(), myDrawer->TextAspect(), yDir, value, myYLabel.ToCString(), first, last );
|
||||
|
||||
#endif
|
||||
aPresentation->SetInfiniteState (Standard_True);
|
||||
}
|
||||
|
||||
@@ -262,14 +227,12 @@ void AIS_PlaneTrihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSe
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifdef OCC218
|
||||
case -1:
|
||||
{
|
||||
Prior = 5;
|
||||
aSelection->Clear();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -14,8 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define OCC218
|
||||
|
||||
inline AIS_KindOfInteractive AIS_PlaneTrihedron::Type() const
|
||||
{return AIS_KOI_Datum;}
|
||||
|
||||
@@ -26,15 +24,11 @@ inline Standard_Integer AIS_PlaneTrihedron::Signature() const
|
||||
|
||||
inline void AIS_PlaneTrihedron::SetXLabel(const TCollection_AsciiString& aLabel)
|
||||
{
|
||||
#ifdef OCC218
|
||||
myXLabel = aLabel;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
inline void AIS_PlaneTrihedron::SetYLabel(const TCollection_AsciiString& aLabel)
|
||||
{
|
||||
#ifdef OCC218
|
||||
myYLabel = aLabel;
|
||||
#endif
|
||||
}
|
||||
|
@@ -14,9 +14,6 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
|
||||
-- the restricted NameOfColor.
|
||||
|
||||
class Point from AIS inherits InteractiveObject from AIS
|
||||
|
||||
---Purpose: Constructs point datums to be used in construction of
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
||||
// instead a restricted object NameOfColor.
|
||||
|
||||
#include <AIS_Point.ixx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
@@ -130,13 +127,11 @@ void AIS_Point::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Point::SetColor(const Quantity_NameOfColor aCol)
|
||||
#ifdef GER61351
|
||||
{
|
||||
SetColor(Quantity_Color(aCol));
|
||||
}
|
||||
|
||||
void AIS_Point::SetColor(const Quantity_Color &aCol)
|
||||
#endif
|
||||
{
|
||||
hasOwnColor=Standard_True;
|
||||
myOwnColor=aCol;
|
||||
@@ -218,11 +213,7 @@ void AIS_Point::UpdatePointValues()
|
||||
myDrawer->PointAspect().Nullify();
|
||||
return;
|
||||
}
|
||||
#ifdef GER61351
|
||||
Quantity_Color aCol;
|
||||
#else
|
||||
Quantity_NameOfColor aCol;
|
||||
#endif
|
||||
Quantity_Color QCO;
|
||||
Aspect_TypeOfMarker aTOM;
|
||||
Standard_Real aScale;
|
||||
|
@@ -14,11 +14,6 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
|
||||
-- the restricted NameOfColor.
|
||||
-- GG : BUC60915 05/06/01 Enable to compute the requested arrow size if any
|
||||
-- in all dimensions, add a field myArrowSizeIsDefined.
|
||||
|
||||
deferred class Relation from AIS inherits InteractiveObject from AIS
|
||||
|
||||
---Purpose: One of the four types of interactive object in
|
||||
|
@@ -14,11 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||
|
||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||
// if any in all dimensions.
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
|
||||
@@ -60,16 +55,12 @@ AIS_Relation::AIS_Relation(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation
|
||||
:AIS_InteractiveObject(aTypeOfPresentation3d),
|
||||
myVal(1.),
|
||||
myPosition(0.,0.,0.),
|
||||
#ifdef BUC60915
|
||||
myArrowSize( myVal / 10. ),
|
||||
#endif
|
||||
myAutomaticPosition(Standard_True),
|
||||
myExtShape(0),
|
||||
myFirstOffset(0.),mySecondOffset(0.),
|
||||
myIsSetBndBox( Standard_False )
|
||||
#ifdef BUC60915
|
||||
,myArrowSizeIsDefined( Standard_False)
|
||||
#endif
|
||||
myIsSetBndBox( Standard_False ),
|
||||
myArrowSizeIsDefined( Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||
// if any in all dimensions.
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstShape
|
||||
//purpose :
|
||||
@@ -160,9 +157,7 @@ inline Standard_Real AIS_Relation::ArrowSize() const
|
||||
inline void AIS_Relation::SetArrowSize(const Standard_Real anArrowSize)
|
||||
{
|
||||
myArrowSize = anArrowSize;
|
||||
#ifdef BUC60915
|
||||
myArrowSizeIsDefined = Standard_True;
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -16,35 +16,11 @@
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColStd_SequenceOfTransient.hxx>
|
||||
|
||||
#define BUC60953 // SAV_050701 : the array of selected objects has always the same length
|
||||
// independently of number of objects selected. Thus, if there were selected
|
||||
// more than MaxSizeOfResult objects we have got an exception.
|
||||
// Moreover, Select method was optimized a little bit.
|
||||
// Now it checks the state of incoming owner. If the state is 0
|
||||
// there is no searching for object in <myresult> array.
|
||||
|
||||
#define OCC138
|
||||
|
||||
#define OCC189 //SAV: 18//03/02 array was replaced with list.
|
||||
|
||||
#define OCC1039 //SAV: 25/11/02 clearing selected objects if any on the AIS_Selection remove.
|
||||
|
||||
#define USE_MAP //san : 18/04/03 USE_MAP - additional datamap is used to speed up access
|
||||
//to certain owners in <myresult> list
|
||||
|
||||
#ifdef BUC60953
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#endif
|
||||
|
||||
#ifdef OCC138 //VTN Avoding infinit loop in AddOrRemoveSelected and AddOrRemoveCurrentObject methods.
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef USE_MAP
|
||||
#define MaxSizeOfResult 10000
|
||||
#else
|
||||
#define MaxSizeOfResult 100000
|
||||
#endif
|
||||
|
||||
//current selection (handle)
|
||||
static Handle(AIS_Selection) theCurrentSelection;
|
||||
@@ -68,14 +44,9 @@ static TColStd_SequenceOfTransient& AIS_Sel_GetSelections()
|
||||
//=======================================================================
|
||||
AIS_Selection::AIS_Selection(const Standard_CString aName) :
|
||||
myName(TCollection_AsciiString(aName)),
|
||||
#if !defined USE_MAP && !defined OCC189
|
||||
myresult(new TColStd_HArray1OfTransient(1,MaxSizeOfResult)),
|
||||
#endif
|
||||
myNb(0)
|
||||
{
|
||||
#ifdef USE_MAP
|
||||
myResultMap.ReSize( MaxSizeOfResult ); // for maximum performnace on medium selections ( < 100000 objects )
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -150,12 +121,8 @@ void AIS_Selection::Select()
|
||||
AIS_Sel_CurrentSelection (S);
|
||||
if(!S.IsNull()){
|
||||
S->myNb=0;
|
||||
#if defined OCC189 || defined USE_MAP
|
||||
S->myresult.Clear();
|
||||
#ifdef USE_MAP
|
||||
S->myResultMap.Clear();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,66 +148,6 @@ AIS_SelectStatus AIS_Selection::Select(const Handle(Standard_Transient)& anObjec
|
||||
Handle(SelectMgr_EntityOwner) owner = Handle(SelectMgr_EntityOwner)::DownCast( anObject );
|
||||
if ( owner.IsNull() )
|
||||
anAISObj = Handle(AIS_InteractiveObject)::DownCast( anObject );
|
||||
#ifndef OCC189
|
||||
TColStd_Array1OfTransient& arr = S->myresult->ChangeArray1();
|
||||
|
||||
Standard_Integer Found(-1);
|
||||
Standard_Integer i ;
|
||||
|
||||
#ifdef BUC60953
|
||||
|
||||
Standard_Boolean selected = Standard_False;
|
||||
if ( !owner.IsNull() )
|
||||
selected = owner->State() != 0;
|
||||
#ifdef OCC138
|
||||
else if(!anAISObj.IsNull())
|
||||
selected = anAISObj->State();
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( selected ) // looking up index of object
|
||||
#endif
|
||||
|
||||
for( i=arr.Lower() && Found==-1;i<=S->myNb;i++){
|
||||
if(arr(i)==anObject)
|
||||
Found=i;
|
||||
}
|
||||
// If it is not inside, it is added...
|
||||
|
||||
#ifdef BUC60953
|
||||
if ( !selected || Found == -1 ) {
|
||||
#else
|
||||
if(Found==-1){
|
||||
#endif
|
||||
if((S->myNb)+1>arr.Length()){
|
||||
Handle(TColStd_HArray1OfTransient) NiouTab = new TColStd_HArray1OfTransient(1,arr.Length()+MaxSizeOfResult);
|
||||
for(i=arr.Lower();i<=S->myNb;i++){
|
||||
const Handle(Standard_Transient)& T = S->myresult->Value(i);
|
||||
NiouTab->SetValue(i,T);
|
||||
}
|
||||
#ifdef BUC60953
|
||||
S->myresult = NiouTab;
|
||||
#endif
|
||||
}
|
||||
(S->myNb)++;
|
||||
S->myresult->SetValue(S->myNb,anObject);
|
||||
return AIS_SS_Added;
|
||||
}
|
||||
// it was inside and it is removed...
|
||||
for(i=Found;i<=S->myNb;i++)
|
||||
arr(i)=arr(i+1);
|
||||
S->myNb--;
|
||||
#elif !defined USE_MAP //OCC189
|
||||
AIS_NListTransient::Iterator anIter ( S->myresult );
|
||||
for ( ; anIter.More(); anIter.Next() )
|
||||
if ( anIter.Value() == anObject ) {
|
||||
S->myresult.Remove( anIter );
|
||||
return AIS_SS_Removed;
|
||||
}
|
||||
|
||||
S->myresult.Append( anObject );
|
||||
return AIS_SS_Added;
|
||||
#else //USE_MAP
|
||||
if ( S->myResultMap.IsBound( anObject ) ){
|
||||
AIS_NListTransient::Iterator aListIter = S->myResultMap.Find( anObject );
|
||||
//skt-----------------------------------------------------------------
|
||||
@@ -251,14 +158,12 @@ AIS_SelectStatus AIS_Selection::Select(const Handle(Standard_Transient)& anObjec
|
||||
S->myIterator = AIS_NListTransient::Iterator();
|
||||
}
|
||||
//--------------------------------------------------------------------
|
||||
#ifdef BUC60953
|
||||
// In the mode of advanced mesh selection only one owner is created
|
||||
// for all selection modes. It is necessary to check the current detected
|
||||
// entity and remove the owner from map only if the detected entity is
|
||||
// the same as previous selected (IsForcedHilight call)
|
||||
if( !anAISObj.IsNull() || ( !owner.IsNull() && !owner->IsForcedHilight() ) )
|
||||
{
|
||||
#endif
|
||||
S->myresult.Remove( aListIter );
|
||||
S->myResultMap.UnBind( anObject );
|
||||
|
||||
@@ -280,7 +185,6 @@ AIS_SelectStatus AIS_Selection::Select(const Handle(Standard_Transient)& anObjec
|
||||
S->myresult.Append( anObject, aListIter );
|
||||
S->myResultMap.Bind( anObject, aListIter );
|
||||
return AIS_SS_Added;
|
||||
#endif //USE_MAP
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -293,29 +197,12 @@ AIS_SelectStatus AIS_Selection::AddSelect(const Handle(Standard_Transient)& anOb
|
||||
AIS_Sel_CurrentSelection (S);
|
||||
if(S.IsNull()) return AIS_SS_NotDone;
|
||||
|
||||
#ifndef OCC189
|
||||
TColStd_Array1OfTransient& arr = S->myresult->ChangeArray1();
|
||||
Standard_Integer i;
|
||||
if((S->myNb)+1>arr.Length()){
|
||||
Handle(TColStd_HArray1OfTransient) NiouTab = new TColStd_HArray1OfTransient(1,arr.Length()+MaxSizeOfResult);
|
||||
for(i=arr.Lower();i<=S->myNb;i++){
|
||||
const Handle(Standard_Transient)& T = S->myresult->Value(i);
|
||||
NiouTab->SetValue(i,T);
|
||||
}
|
||||
S->myresult = NiouTab;
|
||||
}
|
||||
(S->myNb)++;
|
||||
S->myresult->SetValue(S->myNb,anObject);
|
||||
#elif !defined USE_MAP //OCC189
|
||||
S->myresult.Append( anObject );
|
||||
#else //USE_MAP
|
||||
if ( S->myResultMap.IsBound( anObject ) )
|
||||
return AIS_SS_NotDone;
|
||||
|
||||
AIS_NListTransient::Iterator aListIter;
|
||||
S->myresult.Append( anObject, aListIter );
|
||||
S->myResultMap.Bind( anObject, aListIter );
|
||||
#endif
|
||||
return AIS_SS_Added;
|
||||
}
|
||||
|
||||
@@ -343,11 +230,7 @@ void AIS_Selection::ClearAndSelect(const Handle(Standard_Transient)& anObject) {
|
||||
Standard_Integer AIS_Selection::Extent() {
|
||||
Handle(AIS_Selection) S;
|
||||
AIS_Sel_CurrentSelection (S);
|
||||
#if !defined OCC189 && !defined USE_MAP
|
||||
return S->myNb;
|
||||
#else
|
||||
return S->myresult.Extent();
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -371,15 +254,7 @@ Standard_Boolean AIS_Selection::IsSelected(const Handle(Standard_Transient)& anO
|
||||
Handle(AIS_Selection) S;
|
||||
AIS_Sel_CurrentSelection (S);
|
||||
if(S.IsNull()) return Standard_False;
|
||||
#ifndef USE_MAP
|
||||
for(S->Init();S->More();S->Next()){
|
||||
if(S->Value()==anObject)
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
#else
|
||||
return S->myResultMap.IsBound( anObject );
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -407,12 +282,10 @@ void AIS_Selection::Remove(const Standard_CString aName)
|
||||
{
|
||||
Standard_Integer I = AIS_Selection::Index(aName);
|
||||
if(I!=0) {
|
||||
#ifdef OCC1039
|
||||
Handle(AIS_Selection) selection = Handle(AIS_Selection)::DownCast( AIS_Sel_GetSelections().Value(I) );
|
||||
Standard_Integer stored = selection->NbStored();
|
||||
if ( stored )
|
||||
selection->Select();
|
||||
#endif
|
||||
AIS_Sel_GetSelections().Remove(I);
|
||||
}
|
||||
}
|
||||
|
@@ -14,15 +14,6 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
|
||||
-- the restricted NameOfColor.
|
||||
-- Redefines the Color(),Material(),Transparency() methods
|
||||
-- for taking in acount the current facing model.
|
||||
-- GG : BUC60536 The compute methods must be defined "protected"
|
||||
-- and no more "private"
|
||||
|
||||
|
||||
|
||||
class Shape from AIS inherits InteractiveObject from AIS
|
||||
|
||||
---Purpose: A framework to manage presentation and selection of shapes.
|
||||
|
@@ -14,9 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||
// if any in all dimensions.
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <AIS_SymmetricRelation.ixx>
|
||||
@@ -498,9 +495,7 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta
|
||||
mySAttach = ElCLib::Value(ElCLib::Parameter(line2,myFAttach),line2);
|
||||
}
|
||||
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined )
|
||||
#endif
|
||||
myArrowSize = myFAttach.Distance(mySAttach)/50.;
|
||||
//----------------------------------------------------
|
||||
|
||||
@@ -599,9 +594,7 @@ void AIS_SymmetricRelation::ComputeTwoVerticesSymmetric(const Handle(Prs3d_Prese
|
||||
AIS::ComputeGeometry(TopoDS::Vertex(myFShape), myFAttach, myPlane, isOnPlane1);
|
||||
AIS::ComputeGeometry(TopoDS::Vertex(mySShape), mySAttach, myPlane, isOnPlane2);
|
||||
|
||||
#ifdef BUC60915
|
||||
if( !myArrowSizeIsDefined )
|
||||
#endif
|
||||
myArrowSize = myFAttach.Distance(mySAttach)/50.;
|
||||
|
||||
if (isOnPlane1 && isOnPlane2)
|
||||
|
@@ -15,11 +15,6 @@
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- Modified by: rob Wed Feb 11 -> Size of Trihedron
|
||||
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
|
||||
-- the restricted NameOfColor.
|
||||
-- GG : IMP120100 Add SetTextColor() methods.
|
||||
-- SetArrowColor() methods.
|
||||
|
||||
|
||||
class Trihedron from AIS inherits InteractiveObject from AIS
|
||||
|
||||
|
@@ -14,10 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||
|
||||
#define IMP120100 // GG Add SetTextColor() and SetArrowColor() methods
|
||||
|
||||
#include <AIS_Trihedron.ixx>
|
||||
#include <DsgPrs_DatumPrs.hxx>
|
||||
#include <SelectBasics_EntityOwner.hxx>
|
||||
@@ -63,11 +59,9 @@
|
||||
//=======================================================================
|
||||
AIS_Trihedron::AIS_Trihedron(const Handle(Geom_Axis2Placement)& aComponent):
|
||||
myComponent(aComponent),
|
||||
myHasOwnSize(Standard_False)
|
||||
#ifdef IMP120100
|
||||
,myHasOwnTextColor(Standard_False)
|
||||
,myHasOwnArrowColor(Standard_False)
|
||||
#endif
|
||||
myHasOwnSize(Standard_False),
|
||||
myHasOwnTextColor(Standard_False),
|
||||
myHasOwnArrowColor(Standard_False)
|
||||
|
||||
{ LoadSubObjects();}
|
||||
|
||||
@@ -452,7 +446,6 @@ void AIS_Trihedron::SetColor(const Quantity_Color &aCol)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
#ifdef IMP120100
|
||||
void AIS_Trihedron::SetTextColor(const Quantity_NameOfColor aCol)
|
||||
{
|
||||
myHasOwnTextColor = Standard_True;
|
||||
@@ -512,7 +505,6 @@ Quantity_NameOfColor AIS_Trihedron::ArrowColor() const {
|
||||
|
||||
return myOwnArrowColor;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//=======================================================================
|
||||
@@ -588,7 +580,6 @@ void AIS_Trihedron::UnsetColor()
|
||||
myDrawer->DatumAspect()->FirstAxisAspect()->SetColor(myOwnColor);
|
||||
myDrawer->DatumAspect()->SecondAxisAspect()->SetColor(myOwnColor);
|
||||
myDrawer->DatumAspect()->ThirdAxisAspect()->SetColor(myOwnColor);
|
||||
#ifdef IMP120100
|
||||
if( HasTextColor() ) {
|
||||
SetTextColor(myOwnColor.Name());
|
||||
myHasOwnTextColor = Standard_False;
|
||||
@@ -597,7 +588,6 @@ void AIS_Trihedron::UnsetColor()
|
||||
SetArrowColor(myOwnColor.Name());
|
||||
myHasOwnArrowColor = Standard_False;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user