Unused code paths (including definition of these macros and meaningless comments) were eliminated.
-- 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.
// 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>
// 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>
myText = aText;
myPosition = aPosition;
mySymbolPrs = aSymbolPrs;
-#ifdef BUC60915
SetArrowSize( anArrowSize );
-#else
- myArrowSize = anArrowSize;
-#endif
myAutomaticPosition = Standard_False;
}
//determiner la taille de la fleche
//-------------------------------------------------
-#ifdef BUC60915
if( !myArrowSizeIsDefined ) {
-#endif
Standard_Real arrsize = myArrowSize;
if ( (myVal/4) < arrsize)
arrsize = myVal/4;
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,
// 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>
myText = aText;
myPosition = aPosition;
mySymbolPrs = aSymbolPrs;
-#ifdef BUC60915
SetArrowSize( anArrowSize );
-#else
- myArrowSize = anArrowSize;
-#endif
myAutomaticPosition = Standard_False;
}
//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;
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,
-- 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
// 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>
// 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>
}
}
}
-#ifdef BUC60915
if( !myArrowSizeIsDefined )
-#endif
myArrowSize = (Min(myFirstCenter.Distance(myFirstPoint),
mySecondCenter.Distance(mySecondPoint)))*0.05;
// 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>
myFShape = aShape;
myPlane = aPlane;
myPosition = aPosition;
-#ifdef BUC60915
SetArrowSize( anArrowSize );
-#else
- myArrowSize = anArrowSize;
-#endif
myAutomaticPosition = Standard_False;
}
myFShape = aShape;
myPlane = aPlane;
myPosition = aPosition;
-#ifdef BUC60915
SetArrowSize( anArrowSize );
-#else
- myArrowSize = anArrowSize;
-#endif
myAutomaticPosition = Standard_False;
}
// calculate presentation
// definition of the symbol size
-#ifdef BUC60915
if( !myArrowSizeIsDefined )
-#endif
myArrowSize = 5.;
//creation of the presentation
-- 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:
// 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>
-- 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
// 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>
#include <Prs3d_Presentation.hxx>
-#ifdef OCC9657
#include <AIS_MapOfInteractive.hxx>
#include <AIS_MapIteratorOfMapOfInteractive.hxx>
-#endif
//=======================================================================
//function : MoveTo
Standard_Boolean HasHiCol;
if(IsHilighted(anIObj,HasHiCol,HiCol)){
if(HasHiCol && HiCol!= mySelectionColor) {
-#ifdef UKI60826
HilightWithColor(anIObj,mySelectionColor,updateviewer);
-#else
- Hilight(anIObj,updateviewer);
-#endif
}
}
return;
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();
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);
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)
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();
}
}
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();
// 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>
}
}
-#ifdef IMP051001
//=======================================================================
//function : SetZDetection
//purpose :
{
return myZDetectionFlag;
}
-#endif
-- 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:
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;
// 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>
{
Handle (AIS_InteractiveContext) Bid;
myCTXPtr = Bid.operator->();
-#ifdef GER61351
SetCurrentFacingModel();
-#endif
}
//=======================================================================
//=======================================================================
void AIS_InteractiveObject::SetDisplayMode(const Standard_Integer aMode)
{
-#ifdef BUC60632
if( AcceptDisplayMode(aMode) )
-#endif
myDisplayMode = aMode;
}
//function :
//purpose :
//=======================================================================
-#ifdef GER61351
void AIS_InteractiveObject::SetCurrentFacingModel(const Aspect_TypeOfFacingModel aModel) {
myCurrentFacingModel = aModel;
}
Aspect_TypeOfFacingModel AIS_InteractiveObject::CurrentFacingModel() const {
return myCurrentFacingModel;
}
-#endif
//=======================================================================
//function : SetColor
//=======================================================================
void AIS_InteractiveObject::SetColor(const Quantity_NameOfColor aColor)
-#ifdef GER61351
{
SetColor(Quantity_Color(aColor));
}
//=======================================================================
void AIS_InteractiveObject::SetColor(const Quantity_Color &aColor)
-#endif
{
myOwnColor = aColor;
hasOwnColor = Standard_True;
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;
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);
}
//=======================================================================
void AIS_InteractiveObject::UnsetMaterial()
{
-#ifdef BUC60577
if( !HasMaterial() ) return;
if( HasColor() || IsTransparent()) {
myDrawer->ShadingAspect()->SetMaterial(
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);
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());
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;
}
//=======================================================================
void AIS_InteractiveObject::UnsetTransparency()
{
-#ifdef BUC60577 // Back & Front material can be different !
if(HasColor() || HasMaterial() )
{
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
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);
// 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;}
-- 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
// 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>
-- 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
//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>
#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;
}
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
// - 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>
#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>
#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)
{
}
}
-#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;
}
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;
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);
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);
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);
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));
}
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()){
//=======================================================================
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());
Standard_Boolean found(Standard_False);
-#ifdef OCC9026
if (!found) {
SelectMgr_DataMapIteratorOfDataMapOfIntegerSensitive aSensitiveIt (myMainVS->Primitives());
for (; aSensitiveIt.More(); aSensitiveIt.Next()) {
}
}
}
-#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 :
{
return MoreDetected() ? myAISDetectedSeq(myAISCurDetected) : NULL;
}
-#endif
// 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>
mySymbolPrs = aSymbolPrs;
myPosition = aPosition;
myAutomaticPosition = Standard_False;
-#ifdef BUC60915
SetArrowSize( anArrowSize );
-#else
- myArrowSize = anArrowSize;
-#endif
}
//=======================================================================
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;
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;
// 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>
mySymbolPrs = aSymbolPrs;
myPosition = aPosition;
myAutomaticPosition = Standard_False;
-#ifdef BUC60915
SetArrowSize( anArrowSize );
-#else
- myArrowSize = anArrowSize;
-#endif
}
//=======================================================================
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;
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;
// 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>
mySShape = aSShape;
myPlane = aPlane;
myAutomaticPosition = Standard_False;
-#ifdef BUC60915
SetArrowSize( anArrowSize );
-#else
- myArrowSize = anArrowSize;
-#endif
myPosition = aPosition;
mySymbolPrs = aSymbolPrs;
}
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 )
{
-- 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
// 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>
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;
-- 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
// 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>
#include <Select3D_SensitiveFace.hxx>
-#define OCC10
-
void ExtremityPoints(TColgp_Array1OfPnt& PP,const Handle(Geom_Plane)& myPlane,const Handle(Prs3d_Drawer)& myDrawer);
//=======================================================================
myShapes[1] = XAxis();
myShapes[2] = YAxis();
-#ifdef OCC218
myXLabel = TCollection_AsciiString( "X" );
myYLabel = TCollection_AsciiString( "Y" );
-#endif
}
//=======================================================================
//function : XAxis
//purpose :
//=======================================================================
-#ifdef OCC218
Handle(AIS_Line) AIS_PlaneTrihedron::XAxis() const
{
Handle(Geom_Line) aGLine = new Geom_Line(myPlane->Pln().XAxis());
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());
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
return aPt;
}
-#ifdef OCC10
void AIS_PlaneTrihedron::SetLength(const Standard_Real theLength) {
myDrawer->DatumAspect()->SetAxisLength(theLength, theLength, theLength);
SetToUpdate();
Standard_Real AIS_PlaneTrihedron::GetLength() const {
return myDrawer->DatumAspect()->FirstAxisLength();
}
-#endif
//=======================================================================
//function : Compute
{
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();
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);
}
}
break;
}
-#ifdef OCC218
case -1:
{
Prior = 5;
aSelection->Clear();
break;
}
-#endif
}
}
// 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;}
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
}
-- 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
// 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>
//=======================================================================
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;
myDrawer->PointAspect().Nullify();
return;
}
-#ifdef GER61351
Quantity_Color aCol;
-#else
- Quantity_NameOfColor aCol;
-#endif
Quantity_Color QCO;
Aspect_TypeOfMarker aTOM;
Standard_Real aScale;
-- 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
// 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>
: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)
{
}
// 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 :
inline void AIS_Relation::SetArrowSize(const Standard_Real anArrowSize)
{
myArrowSize = anArrowSize;
-#ifdef BUC60915
myArrowSizeIsDefined = Standard_True;
-#endif
}
//=======================================================================
#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;
//=======================================================================
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
}
//=======================================================================
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
}
}
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-----------------------------------------------------------------
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 );
S->myresult.Append( anObject, aListIter );
S->myResultMap.Bind( anObject, aListIter );
return AIS_SS_Added;
-#endif //USE_MAP
}
//=======================================================================
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;
}
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
}
//=======================================================================
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
}
//=======================================================================
{
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);
}
}
-- 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.
// 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>
mySAttach = ElCLib::Value(ElCLib::Parameter(line2,myFAttach),line2);
}
-#ifdef BUC60915
if( !myArrowSizeIsDefined )
-#endif
myArrowSize = myFAttach.Distance(mySAttach)/50.;
//----------------------------------------------------
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)
-- 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
// 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>
//=======================================================================
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();}
//purpose :
//=======================================================================
-#ifdef IMP120100
void AIS_Trihedron::SetTextColor(const Quantity_NameOfColor aCol)
{
myHasOwnTextColor = Standard_True;
return myOwnArrowColor;
}
-#endif
//=======================================================================
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;
SetArrowColor(myOwnColor.Name());
myHasOwnArrowColor = Standard_False;
}
-#endif
}
// MyHatchStyle : HatchStyle;
-#define OCC1174 // SAV : 08/01/03 Added back face interior color
-
//-Constructors
//-Destructors
MyInteriorStyle = Aspect_IS_EMPTY;
MyInteriorColor = Quantity_NOC_CYAN1;
-#ifdef OCC1174
MyBackInteriorColor = Quantity_NOC_CYAN1;
-#endif
MyEdgeColor = Quantity_NOC_WHITE;
MyEdgeType = Aspect_TOL_SOLID;
MyEdgeWidth = 1.0;
void Aspect_AspectFillArea::SetBackInteriorColor( const Quantity_Color& color )
{
-#ifdef OCC1174
MyBackInteriorColor = color;
-#endif
}
void Aspect_AspectFillArea::SetEdgeColor (const Quantity_Color& AColor) {
AStyle = MyInteriorStyle;
AIntColor = MyInteriorColor;
-#ifdef OCC1174
BackIntColor = MyBackInteriorColor;
-#endif
AEdgeColor = MyEdgeColor;
AType = MyEdgeType;
AWidth = MyEdgeWidth;
// Modified 23/02/98 : FMN ; Remplacement PI par Standard_PI
-#define CSR577 //GG 25/09/00 Avoid to have unaccuracy coordinates computation
-// when the grid is activated.
-
-#define OCC192_193 // jfa 27/02/2002
-// for big rotation angles - error of negative values expression in round numbers
-
-#define xTRACE
-
#include <Aspect_CircularGrid.ixx>
#include <Aspect_Grid.hxx>
#include <Standard_NumericError.hxx>
Quantity_Length& gridX,
Quantity_Length& gridY) const {
-#ifdef TRACE
- if( X == 0. || Y == 0. ) {
- cout << " Aspect_CircularGrid" << endl;
- }
-#endif
Standard_Real xo = XOrigin();
Standard_Real yo = YOrigin();
Standard_Real d = Sqrt( (xo-X)*(xo-X) + (yo-Y)*(yo-Y) );
Standard_Real a = ACos(cosinus);
Standard_Real ra = RotationAngle();
if ( Y < yo ) a = 2 * M_PI - a;
-#ifdef OCC192_193
n = (Standard_Integer ) ((a-ra)/myAlpha + Sign(0.5, a-ra)) ;
-#else
- n = (Standard_Integer ) ((a-ra)/myAlpha +0.5 ) ;
-#endif
-#ifdef CSR577
Standard_Real cs=0,sn=0;
Standard_Boolean done = Standard_False;
Standard_Integer nmax = 2*myDivisionNumber;
Standard_Real ang = ra + Standard_Real(n)*myAlpha;
cs = Cos(ang); sn = Sin(ang);
}
-#else
- Standard_Real ang = RotationAngle()+ Standard_Real(n)*myAlpha;
- Standard_Real cs = Cos(ang);
- Standard_Real sn = Sin(ang);
-#endif
gridX = xo + cs * radius;
gridY = yo + sn * radius;
-#ifdef TRACE
- cout << "Aspect_CircularGrid::Compute (" << Quantity_Length (X) << ", "
- << Quantity_Length (Y) << ", " << Quantity_Length (gridX) << ", "
- << Quantity_Length (gridY) << ")" << endl;
-#endif
}
Quantity_Length Aspect_CircularGrid::RadiusStep() const {
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
--- Updated: GG IMP230300 Add grid color parameters in constructor
--- and add new methods SetColors() & Colors()
-
deferred class Grid from Aspect
inherits TShared from MMgt
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-// Updated: GG IMP230300 Add grid color parameters in constructor
-// and add new methods SetColors() & Colors()
-
#include <Aspect_Grid.ixx>
// Modified 23/02/98 : FMN ; Remplacement PI par Standard_PI
-#define CSR577 //GG 25/09/00 Avoid to have unaccuracy coordinates computation
-// when the grid is activated.
-
-#define xTRACE
-
#include <Aspect_RectangularGrid.ixx>
Standard_Integer n2 = Standard_Integer ( Abs(D2)/myYStep + 0.5);
Standard_Real offset1 = c1 + Standard_Real(n1) * Sign (myXStep , D1);
Standard_Real offset2 = c2 + Standard_Real(n2) * Sign (myYStep , D2);
-#ifdef CSR577
Standard_Real Delta = a1*b2 - b1*a2;
gridX = ( offset2*a1 - offset1*a2) /Delta;
gridY = ( offset2*b1 - offset1*b2) /Delta;
-#else
- Standard_Real Delta = b1*a2 - a1*b2;
- gridX = ( offset1*a2 - offset2*a1) /Delta;
- gridY = ( offset1*b2 - offset2*b1) /Delta;
-#endif
-#ifdef TRACE
- cout << "Aspect_RectangularGrid::Compute (" << Quantity_Length (X) << ", "
- << Quantity_Length (Y) << ", " << Quantity_Length (gridX) << ", "
- << Quantity_Length (gridY) << ")" << endl;
-#endif
}
Quantity_Length Aspect_RectangularGrid::XStep() const {
// b2 = Sin (mySecondAngle + RotationAngle() + M_PI / 2.);
// c2 = XOrigin() * b2 - YOrigin() * a2;
-#ifdef CSR577
Standard_Real angle1 = myFirstAngle + RotationAngle();
Standard_Real angle2 = mySecondAngle + RotationAngle();
if ( angle1 != 0. ) {
} else {
a2 = -1.; b2 = 0.; c2 = YOrigin();
}
-#else
- a1 = -Sin (myFirstAngle + RotationAngle());
- b1 = Cos (myFirstAngle + RotationAngle());
- c1 = XOrigin() * b1 - YOrigin() * a1;
-
- a2 = -Sin (mySecondAngle + RotationAngle() + M_PI / 2.);
- b2 = Cos (mySecondAngle + RotationAngle() + M_PI / 2.);
- c2 = XOrigin() * b2 - YOrigin() * a2;
-#endif
//-zov
}
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-// Modified: Tue Oct 15 10:12:02 1996
-// correction in BuildFilletEdge (PRO3529 : computation of dist)
-// Modified: Tue Oct 22 09:23:11 1996
-// correction in BuildFilletEdge (PRO5827 : computation of vec1)
-// Modified: Tue Oct 22 09:23:11 1996
-// new status in ComputeFillet for degenerated edges (PRO4896)
-// Modified: Thu Dec 5 16:25:44 1996
-// correction in BuildFilletEdge (PRO4896 : NewExtr1, NewExtr2)
-// Modified: Tue Apr 22 16:25:44 1996
-// correction in BuildFilletEdge (ID140047 : inside)
-// Modified: Fri Oct 24 10:47:52 1997
-// distinction point de tangence --> on arrete
-// point de rebroussement --> on continue
-// (PRO10404 : Ve3, Ve4)
-// Modified: Tue Oct 28 11:55:53 1997
-// construction de filletEdge avec les parametres U1 et Vv1
-// au lieu des vertex (PRO10434)
-// Modified: Tue Apr 7 14:35:58 1998
-// construction de filletEdge avec les parametres U1 et Vv1
-// ET les vertex NewExtr1, NewExtr2 sinon pb sur qq aretes
-// degenerees (GER60069 + controle de PRO10434)
-// Modified: Mon Jun 22 13:32:25 1998
-// verification de la validite des parametres (PRO13078 partiel)
-// Modified: Fri Sep 25 09:38:04 1998
-// status = ChFi2d_NotAuthorized si les aretes ne sont pas
-// des droites ou des cercles; fonction IsLineOrCircle
-// (BUC60288)
-
-
-
#include <ChFi2d.hxx>
#include <ChFi2d_Builder.ixx>
#include <Standard_NullObject.hxx>
#include <Standard_NotImplemented.hxx>
-#define BUGOCC425
-
#ifdef OBJS
#include <Standard_Persistent.hxx>
DBC_VArray::DBC_VArray(const Standard_Integer Size) : DBC_BaseArray(Size)
{
-#ifdef BUGOCC425
if(Size > 0) {
-#endif
#ifdef CSFDB
myData = (DBC_VArrayTNode*)Standard::Allocate(Size * sizeof(DBC_VArrayTNode));
DBC_VArrayTNode* ptrtmp = (DBC_VArrayTNode*)myData;
myData = new (os_segment::of(this),DBC_VArrayNode::get_os_typespec(),Size) DBC_VArrayNode[Size];
#endif
-#ifdef BUGOCC425
} else {
#ifdef CSFDB
myData = 0L;
myData = NULL;
#endif
}
-#endif
}
DBC_VArray::DBC_VArray(const DBC_VArray& Varray) : DBC_BaseArray(Varray)
void DBC_VArray::Destroy()
{
#ifdef CSFDB
-#ifdef BUGOCC425
if (myData && mySize > 0) {
-#else
- if (myData) {
-#endif
DBC_VArrayTNode* ptrtmp = (DBC_VArrayTNode*)myData;
for(Standard_Integer i = 0; i < mySize; i++) {
ptrtmp->DBC_VArrayTNode::~DBC_VArrayTNode();
#include <Storage_StreamUnknownTypeError.hxx>
#include <Standard_PCharacter.hxx>
-// Propagate the improvement (BUC60808) on all platforms
-// #ifdef WNT
-#define BUC60808
-// BUC60808 : standard output in MS Visual C++ limites the quantity of figures (digits)
-// in part of number after fixed point. The quantity of figures after fixed point
-// could not be more than 15 when we output double number using standard MS VS output operator '<<'.
-// For example, the maximum double value DBL_MAX = 1.7976931348623157e+308 (see float.h) after
-// cout<<setprecision(17)<<DBL_MAX becomes 1.79769313486232e+308 in stream of output
-// (it could be a file stream). When the number 1.79769313486232e+308 is read from the
-// i/o streame (file, for example) it occurs more than allowed maximum value of double
-// type - 1.7976931348623157e+308. Such value is considered as infinite. When it is written
-// to file (for example) again it is written as 1.#INF. Such value can't be read from file next time.
-//#endif
-
const Standard_CString MAGICNUMBER = "CMPFILE";
//=======================================================================
Storage_BaseDriver& FSD_CmpFile::GetReal(Standard_Real& aValue)
{
-#ifdef BUC60808
char realbuffer[100];
realbuffer[0] = '\0';
}
return *this;
-#else
- if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
-
- return *this;
-#endif
}
//=======================================================================
Storage_BaseDriver& FSD_CmpFile::GetShortReal(Standard_ShortReal& aValue)
{
-#ifdef BUC60808
char realbuffer[100];
Standard_Real r = 0.0;
aValue = (Standard_ShortReal)r;
return *this;
-#else
- if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
- return *this;
-#endif
}
//=======================================================================
static Standard_Integer NbSECTIONS = 0;
#endif
-//#define GF_DEB
//=======================================================================
//function : GeomFill_SweepSectionGenerator
//purpose :
-- and derivated used for model presentation.
-- Required: enumeration TypeOfPrimitive;
-- imported PrimitiveArray; class PrimitiveList.
--- 17-12-01 : GG ; IMP171201 : Add material name UserDefined
-- Thanks to Stephane ROUTELOUS
-- 20-01-2009 : ABD Integration support of system fonts (using FTGL and FreeType)
-- Objective : Specifications definitives
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define XTRACE
-#define XDESTROY
-
// 11/97 ; CAL : retrait des DataStructure
void Graphic3d_DataStructureManager::Destroy () {
-#ifdef DESTROY
- cout << "Graphic3d_DataStructureManager::Destroy ()\n";
-#endif
-
}
-- 26-03-99 : FMN ; Compatibilite ascendante: Ajout methodes SetColor() et Color()
-- 09-04-99 : GG ; Compatibilite ascendante:
-- NameOfPhysicalMaterial disparait.
--- 23-11-99 : GG : GER61351 Add Name() & Reset() methods
--- IMP150200: GG : Add IsEqual() IsDifferent() methods.
--- Add NumberOfMaterials() MaterialName() class methods
--- IMP171201: GG : Add MaterialName(), SetMaterialName()
--- instance methods and field MyRequestedMaterialName
class MaterialAspect from Graphic3d
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define XTRACE
-
-
-
//-Version
//-Design Declaration of variables specific to managers
void Graphic3d_StructureManager::Destroy () {
-#ifdef TRACE
- cout << "Graphic3d_StructureManager::Destroy (" << MyId << ")\n";
- cout << flush;
-#endif
-
MyDisplayedStructure.Clear ();
MyHighlightedStructure.Clear ();
StructureManager_ArrayId[MyId] = 0;
void Graphic3d_StructureManager::Remove (const Standard_Integer AnId) {
-#ifdef TRACE
- cout << "Graphic3d_StructureManager::Remove " << AnId << "\n" << flush;
-#endif
-
MyStructGenId.Free (AnId);
}
Standard_Integer Id = MyStructGenId.Next ();
-#ifdef TRACE
- cout << "Graphic3d_StructureManager::NewIdentification " << Id << "\n";
- cout << flush;
-#endif
-
return Id;
}
//#define No_Standard_OutOfRange
-#define OCC191 // jfa 26/02/2002 Bug of cone display
-
#include <HLRBRep_Data.ixx>
#include <StdFail_UndefinedDerivative.hxx>
mySLProps.SetParameters(pu,pv);
gp_Pnt Pt;
Pt = EC.Value3D(p);
-#ifdef OCC191
if (mySLProps.IsNormalDefined())
-#endif
{
gp_Vec Nm = mySLProps.Normal();
Pt.Transform(T);
#include <IFGraph_ExternalSources.hxx>
#include <Standard_Transient.hxx>
-//#define PRINTDEB
-
-
IFGraph_SCRoots::IFGraph_SCRoots
(const Interface_Graph& agraph, const Standard_Boolean whole)
: IFGraph_StrongComponants (agraph,whole) { }
#include <Interface_Graph.hxx>
#include <Interface_GraphContent.hxx>
-//#define PRINTDEB
-#define pbgraphtool
-
-
IFGraph_StrongComponants::IFGraph_StrongComponants
(const Interface_Graph& agraph, const Standard_Boolean whole)
: IFGraph_SubPartsIterator (agraph, whole) { }
{
Interface_GraphContent iter = Loaded();
Interface_Graph G(thegraph); G.GetFromIter(iter,0);
-#ifdef pbgraphtool
Standard_Integer nb = G.Size();
for (Standard_Integer i = 1; i <= nb; i ++) {
if (!G.IsPresent(i)) continue;
AddPart();
GetFromEntity (G.Entity(i),Standard_False);
}
-#else
-#ifdef OCCT_DEBUG
- cout<<"StrongComponants :"<<endl;
-#endif
- for (IFGraph_SortedStrongs res(G); res.More(); res.Next()) {
- Standard_Integer nb = res.NbVertices();
-#ifdef OCCT_DEBUG
- cout<<" Iteration, Vertices:"<<nb<<" :";
-#endif
- if (nb == 0) continue;
- AddPart();
- for (Standard_Integer i = 1; i <= nb; i ++)
-#ifdef OCCT_DEBUG
- {
- Handle(Standard_Transient) oneres = res.Value(i);
- cout<<" "<<G.EntityNumber(oneres);
- GetFromEntity(oneres,Standard_False);
- }
- cout<<endl;
-#else
- GetFromEntity(res.Value(i),Standard_False);
-#endif
- }
-#endif
}
#include <TDF_Tool.hxx>
#include <TDF_Label.hxx>
-#define BUGOCC425
-
void MDataStd_NameRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,const Handle(TDF_Attribute)& Target,const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_Name) S = Handle(PDataStd_Name)::DownCast (Source);
Handle(TDataStd_Name) T = Handle(TDataStd_Name)::DownCast (Target);
-#ifdef BUGOCC425
if(!S->Get().IsNull()) {
-#endif
TCollection_ExtendedString Name = (S->Get())->Convert ();
T->Set (Name);
-#ifdef BUGOCC425
}
-#endif
}
#include <PCollection_HExtendedString.hxx>
#include <CDM_MessageDriver.hxx>
-#define BUGOCC425
-
MDataStd_NameStorageDriver::MDataStd_NameStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
{
Handle(TDataStd_Name) S = Handle(TDataStd_Name)::DownCast (Source);
Handle(PDataStd_Name) T = Handle(PDataStd_Name)::DownCast (Target);
-#ifdef BUGOCC425
if(S->Get().Length() != 0) {
-#endif
Handle(PCollection_HExtendedString) Name = new PCollection_HExtendedString (S->Get());
T->Set (Name);
-#ifdef BUGOCC425
}
-#endif
}
// szy 23.01.2014 (bug 24565) correction for edge which has null 3d curve representation
// Used for testing DownCast time
-#define MgtBRepSpeedDownCast
#ifdef chrono
#include <OSD_Timer.hxx>
Handle(PGeom_Curve) PP;
if (!TP.IsNull()) {
if (aMap.IsBound(TP)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Persistent) aPers = aMap.Find(TP);
PP = (Handle(PGeom_Curve)&) aPers;
-#else
- PP = Handle(PGeom_Curve)::DownCast(aMap.Find(TP));
-#endif
}
else {
PP = MgtGeom::Translate(TP);
Handle(Geom_Curve) TP;
if (!PP.IsNull()) {
if (aMap.IsBound(PP)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Transient) aTrans = aMap.Find(PP);
TP = (Handle(Geom_Curve)&) aTrans;
-#else
- TP = Handle(Geom_Curve)::DownCast(aMap.Find(PP));
-#endif
}
else {
TP = MgtGeom::Translate(PP);
Handle(PGeom2d_Curve) PP;
if (!TP.IsNull()) {
if (aMap.IsBound(TP)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Persistent) aPers = aMap.Find(TP);
PP = (Handle(PGeom2d_Curve)&) aPers;
-#else
- PP = Handle(PGeom2d_Curve)::DownCast(aMap.Find(TP));
-#endif
}
else {
PP = MgtGeom2d::Translate(TP);
Handle(Geom2d_Curve) TP;
if (!PP.IsNull()) {
if (aMap.IsBound(PP)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Transient) aTrans = aMap.Find(PP);
TP = (Handle(Geom2d_Curve)&) aTrans;
-#else
- TP = Handle(Geom2d_Curve)::DownCast(aMap.Find(PP));
-#endif
}
else {
TP = MgtGeom2d::Translate(PP);
Handle(PGeom_Surface) PP;
if (!TP.IsNull()) {
if (aMap.IsBound(TP)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Persistent) aPers = aMap.Find(TP);
PP = (Handle(PGeom_Surface)&) aPers;
-#else
- PP = Handle(PGeom_Surface)::DownCast(aMap.Find(TP));
-#endif
}
else {
PP = MgtGeom::Translate(TP);
Handle(Geom_Surface) TP;
if (!PP.IsNull()) {
if (aMap.IsBound(PP)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Transient) aTrans = aMap.Find(PP);
TP = (Handle(Geom_Surface)&) aTrans;
-#else
- TP = Handle(Geom_Surface)::DownCast(aMap.Find(PP));
-#endif
}
else {
TP = MgtGeom::Translate(PP);
const Handle(PTopoDS_HShape)& S2,
PTColStd_TransientPersistentMap& aMap) const
{
-#ifdef MgtBRepSpeedDownCast
Handle(TopoDS_TShape) aTransTShape = S1.TShape();
Handle(BRep_TVertex)& TTV = (Handle(BRep_TVertex)&) aTransTShape;
Handle(PTopoDS_TShape) aPersTShape = S2->TShape();
Handle(PBRep_TVertex)& PTV = (Handle(PBRep_TVertex)&) aPersTShape;
-#else
- Handle(BRep_TVertex) TTV = Handle(BRep_TVertex)::DownCast(S1.TShape());
- Handle(PBRep_TVertex) PTV = Handle(PBRep_TVertex)::DownCast(S2->TShape());
-#endif
// Point
PTV->Pnt(TTV->Pnt());
TopoDS_Shape& S2,
PTColStd_PersistentTransientMap& aMap) const
{
-#ifdef MgtBRepSpeedDownCast
Handle(PTopoDS_TShape) aPersTShape = S1->TShape();
Handle(PBRep_TVertex)& PTV = (Handle(PBRep_TVertex)&) aPersTShape;
Handle(TopoDS_TShape) aTransTShape = S2.TShape();
Handle(BRep_TVertex)& TTV = (Handle(BRep_TVertex)&) aTransTShape;
-#else
- Handle(PBRep_TVertex) PTV = Handle(PBRep_TVertex)::DownCast(S1->TShape());
- Handle(BRep_TVertex) TTV = Handle(BRep_TVertex)::DownCast(S2.TShape());
-#endif
// Point
TTV->Pnt(PTV->Pnt());
const Handle(PTopoDS_HShape)& S2,
PTColStd_TransientPersistentMap& aMap) const
{
-#ifdef MgtBRepSpeedDownCast
Handle(TopoDS_TShape) aTransTShape = S1.TShape();
Handle(BRep_TEdge)& TTE = (Handle(BRep_TEdge)&) aTransTShape;
Handle(PTopoDS_TShape) aPersTShape = S2->TShape();
Handle(PBRep_TEdge)& PTE = (Handle(PBRep_TEdge)&) aPersTShape;
-#else
- Handle(BRep_TEdge) TTE = Handle(BRep_TEdge)::DownCast(S1.TShape());
- Handle(PBRep_TEdge) PTE = Handle(PBRep_TEdge)::DownCast(S2->TShape());
-#endif
// tolerance
PTE->Tolerance(TTE->Tolerance());
TopoDS_Shape& S2,
PTColStd_PersistentTransientMap& aMap) const
{
-#ifdef MgtBRepSpeedDownCast
Handle(PTopoDS_TShape) aPersTShape = S1->TShape();
Handle(PBRep_TEdge)& PTE = (Handle(PBRep_TEdge)&) aPersTShape;
Handle(TopoDS_TShape) aTransTShape = S2.TShape();
Handle(BRep_TEdge)& TTE = (Handle(BRep_TEdge)&) aTransTShape;
-#else
- Handle(PBRep_TEdge) PTE = Handle(PBRep_TEdge)::DownCast(S1->TShape());
- Handle(BRep_TEdge) TTE = Handle(BRep_TEdge)::DownCast(S2.TShape());
-#endif
// tolerance
TTE->Tolerance(PTE->Tolerance());
const Handle(PTopoDS_HShape)& S2,
PTColStd_TransientPersistentMap& aMap) const
{
-#ifdef MgtBRepSpeedDownCast
Handle(TopoDS_TShape) aTransTShape = S1.TShape();
Handle(BRep_TFace)& TTF = (Handle(BRep_TFace)&) aTransTShape;
Handle(PTopoDS_TShape) aPersTShape = S2->TShape();
Handle(PBRep_TFace)& PTF = (Handle(PBRep_TFace)&) aPersTShape;
-#else
- Handle(BRep_TFace) TTF = Handle(BRep_TFace)::DownCast(S1.TShape());
- Handle(PBRep_TFace) PTF = Handle(PBRep_TFace)::DownCast(S2->TShape());
-#endif
// natural restriction
PTF->NaturalRestriction(TTF->NaturalRestriction());
TopoDS_Shape& S2,
PTColStd_PersistentTransientMap& aMap) const
{
-#ifdef MgtBRepSpeedDownCast
Handle(PTopoDS_TShape) aPersTShape = S1->TShape();
Handle(PBRep_TFace)& PTF = (Handle(PBRep_TFace)&) aPersTShape;
Handle(TopoDS_TShape) aTransTShape = S2.TShape();
Handle(BRep_TFace)& TTF = (Handle(BRep_TFace)&) aTransTShape;
-#else
- Handle(PBRep_TFace) PTF = Handle(PBRep_TFace)::DownCast(S1->TShape());
- Handle(BRep_TFace) TTF = Handle(BRep_TFace)::DownCast(S2.TShape());
-#endif
// natural restriction
TTF->NaturalRestriction(PTF->NaturalRestriction());
#include <Poly_Array1OfTriangle.hxx>
#include <PPoly_HArray1OfTriangle.hxx>
-#define MgtBRepSpeedDownCast
-
//=======================================================================
//function : ArrayCopy
//purpose : Copy the gp_Pnt
if (!PObj.IsNull()) {
if (aMap.IsBound(PObj)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Transient) aTrans = aMap.Find(PObj);
TT = (Handle(Poly_Triangulation)&) aTrans;
-#else
- TT = Handle(Poly_Triangulation)::DownCast(aMap.Find(PObj));
-#endif
}
else { // translate and bind
Handle(PPoly_Triangulation) PT;
if (!TObj.IsNull()) {
if (aMap.IsBound(TObj)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Persistent) aPers = aMap.Find(TObj);
PT = (Handle(PPoly_Triangulation)&) aPers;
-#else
- PT = Handle(PPoly_Triangulation)::DownCast(aMap.Find(TObj));
-#endif
}
else {
// myNodes
Handle(Poly_Polygon3D) TP;
if (!PObj.IsNull()) {
if (aMap.IsBound(PObj)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Transient) aTrans = aMap.Find(PObj);
TP = (Handle(Poly_Polygon3D)&) aTrans;
-#else
- TP = Handle(Poly_Polygon3D)::DownCast(aMap.Find(PObj));
-#endif
}
else {
Handle(PPoly_Polygon3D) PT;
if (!TObj.IsNull()) {
if (aMap.IsBound(TObj)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Persistent) aPers = aMap.Find(TObj);
PT = (Handle(PPoly_Polygon3D)&) aPers;
-#else
- PT = Handle(PPoly_Polygon3D)::DownCast(aMap.Find(TObj));
-#endif
}
else {
// myNodes
Handle(Poly_Polygon2D) TP;
if (!PObj.IsNull()) {
if (aMap.IsBound(PObj)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Transient) aTrans = aMap.Find(PObj);
TP = (Handle(Poly_Polygon2D)&) aTrans;
-#else
- TP = Handle(Poly_Polygon2D)::DownCast(aMap.Find(PObj));
-#endif
}
else {
// myNodes
Handle(PPoly_Polygon2D) PT;
if (!TObj.IsNull()) {
if (aMap.IsBound(TObj)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Persistent) aPers = aMap.Find(TObj);
PT = (Handle(PPoly_Polygon2D)&) aPers;
-#else
- PT = Handle(PPoly_Polygon2D)::DownCast(aMap.Find(TObj));
-#endif
}
else {
// myNodes
Handle(Poly_PolygonOnTriangulation) TP;
if (!PObj.IsNull()) {
if (aMap.IsBound(PObj)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Transient) aTrans = aMap.Find(PObj);
TP = (Handle(Poly_PolygonOnTriangulation)&) aTrans;
-#else
- TP = Handle(Poly_PolygonOnTriangulation)::DownCast(aMap.Find(PObj));
-#endif
}
else {
Handle(PPoly_PolygonOnTriangulation) PT;
if (!TObj.IsNull()) {
if (aMap.IsBound(TObj)) {
-#ifdef MgtBRepSpeedDownCast
Handle(Standard_Persistent) aPers = aMap.Find(TObj);
PT = (Handle(PPoly_PolygonOnTriangulation)&) aPers;
-#else
- PT = Handle(PPoly_PolygonOnTriangulation)::DownCast(aMap.Find(TObj));
-#endif
}
else {
// myNodes
return retVal;
} // end OSD_File :: KindOfFile
-#define PRO13792
-#ifndef PRO13792
-
-OSD_File OSD_File :: BuildTemporary () {
-
- OSD_Protection prt;
- OSD_File retVal;
#ifdef VAC
char tmpbuf [MAX_PATH];
TCollection_AsciiString fileName ( _ttmpnam ( NULL ) );
#endif
- OSD_Path filePath ( fileName );
-
- retVal.SetPath ( filePath );
- retVal.Build ( OSD_ReadWrite, prt );
-
- return retVal;
-
-} // end OSD_File :: BuildTemporary
-
-#else // PRO13792
//-------------------------------------------------debutpri???980424
} // end OSD_File :: BuildTemporary
-#endif // PRO13792
-
//-------------------------------------------------finpri???980424
#if defined(__CYGWIN32__) || defined(__MINGW32__)
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
--- Modified GG : GER61351 01/02/00 Add SetColor() & Aspect() methods
-
-
class ArrowAspect from Prs3d inherits BasicAspect from Prs3d
---Purpose: A framework for displaying arrows in representations
-- of dimensions and relations.
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define IMP120100 //GG 01/01/00 Add SetColor() methods
-
#include <Prs3d_ArrowAspect.ixx>
Prs3d_ArrowAspect::Prs3d_ArrowAspect ()
: myAngle(M_PI/180.*10), myLength(1.) {
-#ifdef IMP120100
myArrowAspect =
new Graphic3d_AspectLine3d (
Quantity_Color(Quantity_NOC_WHITE), Aspect_TOL_SOLID, 1.0);
-#endif
}
Prs3d_ArrowAspect::Prs3d_ArrowAspect (const Quantity_PlaneAngle anAngle,
const Quantity_Length aLength)
: myAngle(anAngle), myLength(aLength) {
-#ifdef IMP120100
myArrowAspect =
new Graphic3d_AspectLine3d (
Quantity_Color(Quantity_NOC_WHITE), Aspect_TOL_SOLID, 1.0);
-#endif
}
void Prs3d_ArrowAspect::SetAngle ( const Quantity_PlaneAngle anAngle) {
return myLength;
}
-#ifdef IMP120100
void Prs3d_ArrowAspect::SetColor(const Quantity_Color &aColor) {
myArrowAspect->SetColor(aColor);
}
Handle(Graphic3d_AspectLine3d) Prs3d_ArrowAspect::Aspect() const {
return myArrowAspect;
}
-#endif
-- 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 IsoAspect from Prs3d inherits LineAspect from Prs3d
---Purpose: A framework to define the display attributes of isoparameters.
-- This framework can be used to modify the default
// 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 <Prs3d_IsoAspect.ixx>
-#ifdef GER61351
Prs3d_IsoAspect::Prs3d_IsoAspect(const Quantity_Color &aColor,
const Aspect_TypeOfLine aType,
const Standard_Real aWidth,
:Prs3d_LineAspect (aColor,aType,aWidth) {
myNumber = aNumber;
}
-#endif
Prs3d_IsoAspect::Prs3d_IsoAspect(const Quantity_NameOfColor aColor,
const Aspect_TypeOfLine aType,
-- 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 LineAspect from Prs3d inherits BasicAspect from Prs3d
---Purpose: A framework for defining how a line will be displayed
-- in a presentation. Aspects of line display include
// 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 <Prs3d_LineAspect.ixx>
-#ifdef GER61351
Prs3d_LineAspect::Prs3d_LineAspect (const Quantity_Color &aColor,
const Aspect_TypeOfLine aType,
const Standard_Real aWidth) {
myAspect = new Graphic3d_AspectLine3d(aColor,aType,aWidth);
}
-#endif
Prs3d_LineAspect::Prs3d_LineAspect (const Quantity_NameOfColor aColor,
const Aspect_TypeOfLine aType,
(Quantity_Color(aColor),aType,aWidth);
}
-#ifdef GER61351
void Prs3d_LineAspect::SetColor(const Quantity_Color &aColor) {
myAspect->SetColor(aColor);
}
-#endif
void Prs3d_LineAspect::SetColor(const Quantity_NameOfColor aColor) {
myAspect->SetColor(Quantity_Color(aColor));
-- 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 PointAspect from Prs3d inherits BasicAspect from Prs3d
---Purpose: This class defines attributes for the points
// 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 <Prs3d_PointAspect.ixx>
-#ifdef GER61351
Prs3d_PointAspect::Prs3d_PointAspect (const Aspect_TypeOfMarker aType,
const Quantity_Color &aColor,
const Standard_Real aScale) {
myAspect = new Graphic3d_AspectMarker3d(aType,aColor,aScale);
}
-#endif
Prs3d_PointAspect::Prs3d_PointAspect (const Aspect_TypeOfMarker aType,
const Quantity_NameOfColor aColor,
(aColor,aWidth,aHeight,aTexture);
}
-#ifdef GER61351
void Prs3d_PointAspect::SetColor(const Quantity_Color &aColor) {
myAspect->SetColor(aColor);
}
-#endif
void Prs3d_PointAspect::SetColor(const Quantity_NameOfColor aColor) {
myAspect->SetColor(Quantity_Color(aColor));
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
--- Modified: GG IMP020200 Add Transformation() method
-
-
class Presentation from Prs3d inherits Structure from Graphic3d
---Purpose: Defines a presentation object which can be displayed,
// Modified: 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
-#define IMP020200 //GG Add Transformation() method
-
#include <Prs3d_Presentation.ixx>
#include <TColStd_Array2OfReal.hxx>
#include <Graphic3d_Structure.hxx>
SetTransform(Array, Graphic3d_TOC_REPLACE);
}
-#ifdef IMP020200
//=======================================================================
//function : Transformation
//purpose :
return gtrsf;
}
-#endif
//=======================================================================
//function : Place
-- 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.
--- Parameters the color model rule (not especially the front & back side)
--- Add the SetTransparency() method.
--- Add the Color(),Material() and Transparency() methods
-
-
class ShadingAspect from Prs3d inherits BasicAspect from Prs3d
---Purpose: A framework to define the display of shading.
-- The attributes which make up this definition include:
-- 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 TextAspect from Prs3d inherits BasicAspect from Prs3d
---Purpose: Defines the attributes when displaying a text.
// 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 <Prs3d_TextAspect.ixx>
#include <Quantity_Color.hxx>
#include <Font_NameOfFont.hxx>
0.);
}
-#ifdef GER61351
void Prs3d_TextAspect::SetColor(const Quantity_Color &aColor) {
myTextAspect->SetColor(aColor);
}
-#endif
void Prs3d_TextAspect::SetColor(const Quantity_NameOfColor aColor) {
myTextAspect->SetColor(Quantity_Color(aColor));
-- ->Insert Locations Methods...
-- Rob (16/12/97) -> Get the list of modes to be updated
-- -> Flags all the Prs to be updated...
--- GG IMP020200 -> Presentations() method become protected
--- and no more private.
--- SAN (22/03/04) -> OCC4895 High-level interface for controlling
--- polygon offsets: Fill() made protected virtual.
deferred class PresentableObject from PrsMgr inherits TShared from MMgt
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define IMP310300 //GG Don't raise in constructor when an HLS color
-// is defined with hue sets to undefined (grey color)
-
-
//-Version
//-Design Declaration des variables specifiques aux couleurs
break;
case Quantity_TOC_HLS :
-#ifdef IMP310300
if ( (R1 < 0. && R1 != RGBHLS_H_UNDEFINED && R3 != 0.0)
|| (R1 > 360.) ||
-#else
- if ( R1 < 0. || R1 > 359. ||
-#endif
R2 < 0. || R2 > 1. ||
R3 < 0. || R3 > 1. )
Standard_OutOfRange::Raise ("Color out");
break;
case Quantity_TOC_HLS :
-#ifdef IMP310300
if ( R1 < 0. || R1 > 360. ||
-#else
- if ( R1 < 0. || R1 > 359. ||
-#endif
R2 < 0. || R2 > 1. ||
R3 < 0. || R3 > 1. )
Standard_OutOfRange::Raise ("Color out");
hcopy = h;
lmuls = l * s;
-#ifdef IMP310300
if (s == 0.0 && h == RGBHLS_H_UNDEFINED) {
-#else
- if (s == 0.0) {
- if (h == RGBHLS_H_UNDEFINED)
- /* cas teinte indefinie */
- h = RGBHLS_H_UNDEFINED;
- else
-#endif
/* cas achromatique */
r = g = b = l;
}
commercial license or contractual agreement.
*/
-#define CTS17340 /*GG_230797
- changer la definition sjis des caracteres
- " (FF02) -> sjis A1ED
- ' (FF07) -> sjis A1EC
- - (FF0D) -> sjis A1DD
- \ (FF3C) -> sjis A1A1 (sans equivalent -> blank)
- ~ (FF5E) -> sjis 223D
- (FF5F) -> sjis A1A1 (sans equivalent -> blank)
-*/
-
static char16 unisjis [65536] = {
0x0 , 0x0 , 0x0 , 0x0 ,
0x0 , 0x0 , 0x0 , 0x0 ,
0x0 , 0x0 , 0x0 , 0x0 ,
0x0 , 0x0 , 0x0 , 0x0 ,
0x0 , 0x0 , 0x0 , 0x0 ,
-#ifdef CTS17340
0x0 , 0x8149 , 0xa1ed , 0x8194 ,
0x8190 , 0x8193 , 0x8195 , 0xa1ec ,
-#else
-0x0 , 0x8149 , 0x0 , 0x8194 ,
-0x8190 , 0x8193 , 0x8195 , 0x0 ,
-#endif
0x8169 , 0x816a , 0x8196 , 0x817b ,
-#ifdef CTS17340
0x8143 , 0xa1dd , 0x8144 , 0x815e ,
-#else
-0x8143 , 0x0 , 0x8144 , 0x815e ,
-#endif
0x824f , 0x8250 , 0x8251 , 0x8252 ,
0x8253 , 0x8254 , 0x8255 , 0x8256 ,
0x8257 , 0x8258 , 0x8146 , 0x8147 ,
0x826f , 0x8270 , 0x8271 , 0x8272 ,
0x8273 , 0x8274 , 0x8275 , 0x8276 ,
0x8277 , 0x8278 , 0x8279 , 0x816d ,
-#ifdef CTS17340
0xa1a1 , 0x816e , 0x814f , 0x8151 ,
-#else
-0x0 , 0x816e , 0x814f , 0x8151 ,
-#endif
0x814d , 0x8281 , 0x8282 , 0x8283 ,
0x8284 , 0x8285 , 0x8286 , 0x8287 ,
0x8288 , 0x8289 , 0x828a , 0x828b ,
0x8290 , 0x8291 , 0x8292 , 0x8293 ,
0x8294 , 0x8295 , 0x8296 , 0x8297 ,
0x8298 , 0x8299 , 0x829a , 0x816f ,
-#ifdef CTS17340
0x8162 , 0x8170 , 0x223d , 0xa1a1 ,
-#else
-0x8162 , 0x8170 , 0x0 , 0x0 ,
-#endif
0x0 , 0xa1 , 0xa2 , 0xa3 ,
0xa4 , 0xa5 , 0xa6 , 0xa7 ,
0xa8 , 0xa9 , 0xaa , 0xab ,
// fix bug on Compute Depth (don't forget
// Location...)
-#define BUC60858 //GG 27/03/01 Avoid to crash when selecting
-// a triangle containing confused or aligned points.
-
#include <Select3D_SensitiveTriangulation.ixx>
#include <gp_Pnt2d.hxx>
#include <Poly.hxx>
SingularCase = (SingularCase == -1) ? 1 : 2;
}
-#ifdef BUC60858
if (Vtr[2].SquareMagnitude() <= Precision::Confusion())
{
if( SingularCase < 0 ) SingularCase = 1;
}
-#endif
// 3 pts mixed...
if (SingularCase ==2)
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define OCC9026 //AEL Additional method to optimize performance
-//of the FindSelectedOwnerFromShape() method.
-
inline Standard_Real SelectMgr_ViewerSelector::Sensitivity() const
{
return mytolerance;
return myLastPickArgs;
}
-#ifdef OCC9026
inline const SelectMgr_DataMapOfIntegerSensitive& SelectMgr_ViewerSelector::Primitives() const
{
return myentities;
}
-#endif
#define Standard_GUID_SIZE_ALLOC Standard_GUID_SIZE+1
//Fixes incorrect treatment of GUID given as a string with invalid format
-#define OCC669
//=======================================================================
//function : Standard_GUID_MatchChar
while(*tmpbuffer != '\0' && *tmpbuffer != aChar) {tmpbuffer++; result++;}
-#ifdef OCC669
if(*tmpbuffer == '\0') return -1; //The searched symbol wasn't found
-#endif
if (result >= 0) result++;
strtmp[pos] = '\0';
my32b = (Standard_Integer) strtoul(strtmp, (char **)NULL, 16);
}
-#ifdef OCC669
else return NULL;
-#endif
return &tmpBuffer[pos+1];
}
//=======================================================================
strtmp[pos] = '\0';
my32b = (Standard_ExtCharacter) strtoul(strtmp, (char **)NULL, 16);
}
-#ifdef OCC669
else return NULL;
-#endif
// cout << "V16 :" << hex(my32b) << endl;
return &tmpBuffer[pos+1];
}
{
char* tmpBuffer =(char*) aGuid;
-#ifdef OCC669
if(!CheckGUIDFormat(tmpBuffer)) Standard_RangeError::Raise("Invalid format of GUID");
-#endif
-#ifdef OCC669
if((tmpBuffer = Standard_GUID_GetValue32(tmpBuffer,my32b)) == NULL)
Standard_RangeError::Raise("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b1)) == NULL)
Standard_RangeError::Raise("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b3)) == NULL)
Standard_RangeError::Raise("Invalid format of GUID");
-#else
- tmpBuffer = Standard_GUID_GetValue32(tmpBuffer,my32b);
- tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b1);
- tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b2);
- tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b3);
-#endif
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b1);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b2);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b3);
tmpBuffer[i] = '\0';
-#ifdef OCC669
if(!CheckGUIDFormat(tmpBuffer)) Standard_RangeError::Raise("Invalid format of GUID");
-#endif
-#ifdef OCC669
if((tmpBuffer = Standard_GUID_GetValue32(tmpBuffer,my32b)) == NULL)
Standard_RangeError::Raise("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b1)) == NULL)
Standard_RangeError::Raise("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b3)) == NULL)
Standard_RangeError::Raise("Invalid format of GUID");
-#else
- tmpBuffer = Standard_GUID_GetValue32(tmpBuffer,my32b);
- tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b1);
- tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b2);
- tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b3);
-#endif
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b1);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b2);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b3);
// Great zoom leads to non-coincidence of
// a point and non-infinite lines passing throught this point:
-#define OCC64
#include <StdPrs_Curve.ixx>
// Great zoom leads to non-coincidence of
// a point and non-infinite lines passing throught this point:
-#define OCC64
#include <StdPrs_DeflectionCurve.ixx>
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define G005 //ATS,GG 04/01/01 Use PrimitiveArray instead Sets of primitives
-// for performance improvment
-
#include <StdPrs_ShadedSurface.ixx>
#include <Graphic3d_ArrayOfTriangleStrips.hxx>
#include <TopoDS.hxx>
#include <Adaptor2d_Curve2d.hxx>
-
-#define OCC316
-
//=======================================================================
//function : StdPrs_ToolRFace
//purpose :
BRep_Tool::CurveOnSurface(TopoDS::Edge(myExplorer.Current()),
myFace,
U1,U2);
-#ifdef OCC316
if ( !C.IsNull() )
-#endif
DummyCurve.Load(C,U1,U2);
}
}
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define BUC60876 //GG_050401 Enable to highlight something
-// with a specific hilight mode
-
#include <StdSelect_BRepOwner.ixx>
#include <SelectBasics_EntityOwner.hxx>
IsHilighted(const Handle(PrsMgr_PresentationManager)& PM,
const Standard_Integer aMode) const
{
-#ifdef BUC60876
Standard_Integer M = (aMode < 0) ? myCurMode : aMode;
-#else
- Standard_Integer M = (myCurMode==-1) ? aMode:myCurMode;
-#endif
if(myPrsSh.IsNull())
return PM->IsHighlighted(Selectable(),M);
return PM->IsHighlighted(myPrsSh,M);
const Standard_Integer aMode)
{
-#ifdef BUC60876
Standard_Integer M = (aMode < 0) ? myCurMode : aMode;
-#else
- Standard_Integer M = (myCurMode==-1) ? aMode:myCurMode;
-#endif
Handle(SelectMgr_SelectableObject) aSel = Selectable();
if (myFromDecomposition)
{
const Quantity_NameOfColor aCol,
const Standard_Integer aMode)
{
-#ifdef BUC60876
Standard_Integer M = (aMode < 0) ? myCurMode : aMode;
-#else
- Standard_Integer M = (myCurMode==-1) ? aMode:myCurMode;
-#endif
Handle(SelectMgr_SelectableObject) aSel = Selectable();
if (myFromDecomposition)
{
void StdSelect_BRepOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& PM,
const Standard_Integer aMode)
{
-#ifdef BUC60876
Standard_Integer M = (aMode < 0) ? myCurMode : aMode;
-#else
- Standard_Integer M = (myCurMode==-1) ? aMode:myCurMode;
-#endif
if(myPrsSh.IsNull() || !myFromDecomposition)
PM->Unhighlight(Selectable(),M);
else
void StdSelect_BRepOwner::Clear(const Handle(PrsMgr_PresentationManager)& PM,
const Standard_Integer aMode)
{
-#ifdef BUC60876
Standard_Integer M = (aMode < 0) ? myCurMode : aMode;
-#else
- Standard_Integer M = (myCurMode==-1) ? aMode:myCurMode;
-#endif
if (!myPrsSh.IsNull())
PM->Clear(myPrsSh,M);
myPrsSh.Nullify();
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define BUC60576 //GG_5/10/99 Adds Cone to enum TypeOfFace
-
-
#include <StdSelect_FaceFilter.ixx>
#include <BRepAdaptor_Surface.hxx>
#include <TopoDS_Face.hxx>
case StdSelect_Sphere:
{
BRepAdaptor_Surface surf(TopoDS::Face(anobj));
-#ifdef BUC60576
return (surf.GetType() == GeomAbs_Sphere);
-#else
- return (surf.GetType() == GeomAbs_Cone);
-#endif
}
case StdSelect_Torus:
{
BRepAdaptor_Surface surf(TopoDS::Face(anobj));
-#ifdef BUC60576
return ( surf.GetType() == GeomAbs_Torus);
-#else
- return ( surf.GetType() == GeomAbs_Plane || surf.GetType() == GeomAbs_Cone);
-#endif
}
case StdSelect_Revol:
{
return ( surf.GetType() == GeomAbs_Cylinder ||
surf.GetType() == GeomAbs_Cone ||
surf.GetType() == GeomAbs_Torus
-#ifdef BUC60576
||
surf.GetType() == GeomAbs_Sphere ||
surf.GetType() == GeomAbs_SurfaceOfRevolution
-#endif
);
}
-#ifdef BUC60576
case StdSelect_Cone: // waiting for the free cdl, it is used for Cone
{
BRepAdaptor_Surface surf(TopoDS::Face(anobj));
return (surf.GetType() == GeomAbs_Cone);
}
-#endif
}
return Standard_False;
}
#undef TDF_DATA_COMMIT_OPTIMIZED
-#define BUC60879
-
//=======================================================================
//function : TDF_Attribute
//purpose : Initializes fields.
(const Standard_Boolean /*forceIt*/)
{ return Standard_True; }
-#ifdef BUC60879
//=======================================================================
//function : BeforeCommitTransaction
//purpose :
//=======================================================================
void TDF_Attribute::BeforeCommitTransaction() {}
-#endif
//=======================================================================
//function : Backup
// Therefore, these attributes shouldn't be considered by the COPY mechanism and
// the label should be considered as a self-contained.
// Correction of the bug consists of ignoring the attributes not involved by the COPY operation.
-#define BUC60813
//=======================================================================
//function : TDF_CopyLabel
{
myIsDone = Standard_False;
if(mySL.Data()->Root().IsDifferent(myTL.Data()->Root()) && //TDF_Data is not the same
-#ifdef BUC60813
!TDF_Tool::IsSelfContained(mySL, myFilter)) return; //source label isn't self-contained
-#else
- !TDF_Tool::IsSelfContained(mySL)) return;
-#endif
else {
#ifdef OCCT_DEBUG
cout << "THE SAME Data" <<endl;
#undef DEB_DELTA_CREATION
#undef TDF_DATA_COMMIT_OPTIMIZED
-#define BUC60879
-
#ifdef OCCT_DEBUG_DELTA
#define TDF_Data_DebugModified(ACTION) \
cout<<"After "<<ACTION<<" #"<<myTransaction+1<<", DF "<<this<<" had "<<myNbTouchedAtt<<" attribute(s) touched. Time = "<<myTime<<endl; \
itr1.Next();
// currentAtt = itr1.Value();
-#ifdef BUC60879
// A callback:
aPtrCurrentAtt->BeforeCommitTransaction();
-#endif
backupAtt = aPtrCurrentAtt->myBackup;
#include <TDataStd_IntegerArray.ixx>
#include <TDataStd_DeltaOnModificationOfIntArray.hxx>
#include <TDF_DefaultDeltaOnModification.hxx>
-#define OCC925
-#define OCC2932
//=======================================================================
//function : GetID
void TDataStd_IntegerArray::Init(const Standard_Integer lower,
const Standard_Integer upper)
{
-#ifdef OCC925
Backup();
-#endif
myValue = new TColStd_HArray1OfInteger(lower, upper, 0);
}
Standard_Integer anUpper = newArray->Upper();
Standard_Boolean aDimEqual = Standard_False;
Standard_Integer i;
-#ifdef OCC2932
if(Lower() == aLower && Upper() == anUpper ) {
aDimEqual = Standard_True;
return;
}
}
-#endif
Backup();
// Handles of myValue of current and backuped attributes will be different!
#include <TDataStd_RealArray.ixx>
#include <TDataStd_DeltaOnModificationOfRealArray.hxx>
#include <TDF_DefaultDeltaOnModification.hxx>
-#define OCC2932
//=======================================================================
//function : GetID
Standard_Boolean aDimEqual = Standard_False;
Standard_Integer i;
-#ifdef OCC2932
if (Lower() == aLower && Upper() == anUpper ) {
aDimEqual = Standard_True;
Standard_Boolean isEqual = Standard_True;
return;
}
}
-#endif
Backup();
#include <TDataStd_Variable.hxx>
#include <TDF_ListIteratorOfAttributeList.hxx>
-#define OCC387
-
//=======================================================================
//function : GetID
//purpose :
// OCC2932 correction
if(myRelation == R) return;
-#ifdef OCC387
Backup();
-#endif
myRelation = R;
}
#include <TDF_Label.hxx>
#include <Standard_DomainError.hxx>
-// This bug concerns the method IsDescendant():
-#define BUC60817
-
-// This bug concerns the method BeforeForget() - Forget/Resume, Undo/Redo behaviour of the attribute
-#define BUC60844
-
//=======================================================================
//function : Find
//purpose :
Standard_Boolean TDataStd_TreeNode::IsDescendant (const Handle(TDataStd_TreeNode)& ofTN) const
{
-#ifdef BUC60817
-
TDataStd_TreeNode* O = (TDataStd_TreeNode*) this;
while (O->myFather != NULL)
{
return Standard_True;
O = O->myFather;
}
-
-#else
- Handle(TDataStd_TreeNode) current;
- for (current = this; current = current->Father(); current->HasFather()) {
- if (current == ofTN) return Standard_True;
- }
-#endif
return Standard_False;
}
//=======================================================================
void TDataStd_TreeNode::BeforeForget() {
-#ifdef BUC60844
if (!IsBackuped()) {
Remove();
while (HasFirst()) First()->Remove();
}
-#else
- if (!IsBackuped()) Remove();
-#endif
}
//=======================================================================
#include <BRepAdaptor_Curve.hxx>
#include <GeomAbs_CurveType.hxx>
-#define OCC2932
-
//=======================================================================
//function : GetID
//purpose :
{
Handle(TDataXtd_Axis) A = Set (L);
-#ifdef OCC2932
Handle(TNaming_NamedShape) aNS;
if(L.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
if(!aNS->Get().IsNull())
}
}
}
-#endif
TNaming_Builder B (L);
B.Generated (BRepBuilderAPI_MakeEdge(line));
return A;
#include <Geom_Plane.hxx>
#include <GeomLib_IsPlanarSurface.hxx>
-#define OCC2932
-
//=======================================================================
//function : GetID
//purpose :
{
Handle(TDataXtd_Plane) A = Set (L);
-#ifdef OCC2932
Handle(TNaming_NamedShape) aNS;
if(L.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
if(!aNS->Get().IsNull())
}
}
}
-#endif
TNaming_Builder B(L);
B.Generated(BRepBuilderAPI_MakeFace(P));
#include <BRep_Tool.hxx>
-#define OCC2932
-
//=======================================================================
//function : GetID
//purpose :
{
Handle(TDataXtd_Point) A = Set (L);
-#ifdef OCC2932
Handle(TNaming_NamedShape) aNS;
if(L.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
if(!aNS->Get().IsNull())
return A;
}
}
-#endif
TNaming_Builder B(L);
B.Generated(BRepBuilderAPI_MakeVertex(P));
#include <TNaming_Tool.hxx>
#include <TNaming.hxx>
-#define OCC2932
//=======================================================================
//function : Find
//purpose :
A = TDataXtd_Shape::New (label);
}
-#ifdef OCC2932
Handle(TNaming_NamedShape) aNS;
if(label.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
if(!aNS->Get().IsNull())
if(aNS->Get() == shape)
return A;
}
-#endif
TNaming_Builder B(label);
B.Generated(shape);
#include <CDM_MessageDriver.hxx>
-// The improvement concerns returning value of the methods Open(), Save() and SaveAs():
-#define BUC60867
-
// TDocStd_Owner attribute have pointer of closed TDocStd_Document
-#define OCC159
-#ifdef OCC159
#include <TDocStd_Owner.hxx>
-#endif
//=======================================================================
//function : TDocStd_Application
{
}
-#ifdef OCC159
//=======================================================================
//function : Close
//purpose :
aDoc->BeforeClose();
CDF_Application::Close(aDoc);
}
-#endif
//=======================================================================
//function : IsInSession
TCollection_ExtendedString file = tool.Name();
file+=".";
file+=tool.Extension();
-#ifdef BUC60867
status = CanRetrieve(directory,file);
if (status != PCDM_RS_OK) return status;
-#endif
try {
OCC_CATCH_SIGNALS
Handle(TDocStd_Document) D =
file+=tool.Extension();
D->Open(this);
CDF_Store storer (D);
-#ifdef BUC60867
if (!storer.SetFolder(directory))
{
TCollection_ExtendedString aMsg ("TDocStd_Application::SaveAs() - folder ");
MessageDriver()->Write(aMsg.ToExtString());
return storer.StoreStatus(); //CDF_SS_Failure;
}
-#endif
storer.SetName (file);
try {
OCC_CATCH_SIGNALS
}
if(storer.StoreStatus() == PCDM_SS_OK)
D->SetSaved();
-#ifdef BUC60867
#ifdef OCCT_DEBUG
cout<<"TDocStd_Application::SaveAs(): The status = "<<storer.StoreStatus()<<endl;
#endif
return storer.StoreStatus();
-#endif
}
//=======================================================================
//=======================================================================
PCDM_StoreStatus TDocStd_Application::Save (const Handle(TDocStd_Document)& D) {
-#ifdef BUC60867
PCDM_StoreStatus status = PCDM_SS_OK;
-#endif
if (D->IsSaved()) {
CDF_Store storer (D);
try{
}
if(storer.StoreStatus() == PCDM_SS_OK)
D->SetSaved();
-#ifdef BUC60867
status = storer.StoreStatus();
-#endif
} else {
if(!MessageDriver().IsNull()) {
TCollection_ExtendedString aMsg("Document has not been saved yet");
}
status = PCDM_SS_Failure;
}
-#ifdef BUC60867
#ifdef OCCT_DEBUG
cout<<"TDocStd_Application::Save(): The status = "<<status<<endl;
#endif
return status;
-#endif
}
//=======================================================================
#undef DEB_DELTA
-#define BUC60836
-
#define SRN_DELTA_COMPACT
//=======================================================================
cout<<"DF before Undo =================================="<<endl; TDF_Tool::DeepDump(cout,myData);
#endif
Handle(TDF_Delta) D = myData->Undo(myUndos.Last(),Standard_True);
-#ifdef BUC60836
D->SetName(myUndos.Last()->Name());
-#endif
#ifdef OCCT_DEBUG_DELTA
cout<<"DF after Undo =================================="<<endl; TDF_Tool::DeepDump(cout,myData);
#endif
cout<<"DF before Redo =================================="<<endl; TDF_Tool::DeepDump(cout,myData);
#endif
Handle(TDF_Delta) D = myData->Undo(myRedos.First(),Standard_True);
-#ifdef BUC60836
D->SetName(myRedos.First()->Name());
-#endif
#ifdef OCCT_DEBUG_DELTA
cout<<"DF after Redo =================================="<<endl; TDF_Tool::DeepDump(cout,myData);
#endif
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
-#define OCC351
#ifdef OCCT_DEBUG
//#define MDTV_DEB_SC
#ifdef OCCT_DEBUG_SC
}
}
// end szy
-#ifdef OCC351
if (!SC.IsNull()) {
Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(SC,Father);
if (!aNS.IsNull()) {
}
}
}
-#endif
}
#include <TNaming_NCollections.hxx>
-#define BUC60925
-#define OCC352
-
#ifdef OCCT_DEBUG_DBGTOOLS_WRITE
-//#define OCC355
#define MDTV_DEB
#define MDTV_DEB_OR
#define MDTV_DEB_UNN
return TopoDS_Shape();
}
-#ifdef OCC352
-
//=======================================================================
//function : ShapeWithType
//purpose : Tries to make shape with given type from the given shape
return theShape;
}
-#endif
-
//=======================================================================
//function : FindModifUntil
//purpose :
{
TopTools_MapOfShape MS;
TDF_LabelMap Forbiden;
-#ifdef BUC60925
if(!ValidArgs(Args)) return Standard_False;
-#endif
TNaming_NamingTool::BuildDescendants (Stop, Forbiden); // fills Forbidden from Stop
#ifdef OCCT_DEBUG_GEN
{
TopTools_MapOfShape MS;
TDF_LabelMap Forbiden;
-#ifdef BUC60925
if(!ValidArgs(Args)) return Standard_False;
-#endif
TNaming_NamingTool::BuildDescendants (Stop, Forbiden);
TopoDS_Shape S;
const Standard_Integer Index)
{
if (Args.IsEmpty()) return Standard_False;
-#ifdef BUC60925
if(!ValidArgs(Args)) return Standard_False;
-#endif
TNaming_ListIteratorOfListOfNamedShape it(Args);
TopTools_MapOfShape MS;
TDF_LabelMap Forbiden;
const TDF_Label& ContextLabel)
{
if (Args.IsEmpty()) return Standard_False;
-#ifdef BUC60925
if(!ValidArgs(Args)) return Standard_False;
-#endif
// temporary solution for Orientation name
Standard_Boolean isOr(Standard_True);
/* not completed
else cout << "UNION: Shape is NOT found in Context" <<endl;
}
#endif
-#ifdef OCC352
if(found)
B.Select(aCand, aCand);
else {
#endif
B.Select(aShape,aShape);
}
-#else
-
- for (TopTools_MapIteratorOfMapOfShape itM(S.Map()); itM.More(); itM.Next()) {
- const TopoDS_Shape& S = itM.Key();
- B.Select(S,S);
- }
-
-#endif
-
return Standard_True;
}
// First argument : label of generation
// Next arguments : generators.
-#ifdef BUC60925
if(!ValidArgs(Args)) return Standard_False;
-#endif
TDF_Label LabelOfGeneration = Args.First()->Label();
#ifdef OCCT_DEBUG_GEN
if (Args.Extent() > 2) {
Standard_ConstructionError::Raise("TNaming_Name::Solve");
}
-#ifdef BUC60925
if(!ValidArgs(Args)) return Standard_False;
-#endif
const Handle(TNaming_NamedShape)& A = Args.First();
TopTools_MapOfShape MS;
TDF_LabelMap Forbiden;
#endif
TNaming_Builder B(L);
for (TopTools_MapIteratorOfMapOfShape itM(MS); itM.More(); itM.Next()) {
-#ifdef OCC352
const TopoDS_Shape& S = ShapeWithType(itM.Key(),ShapeType);
-#else
- const TopoDS_Shape& S = itM.Key();
-#endif
#ifdef OCCT_DEBUG_SOL2
//TopAbs_Orientation Or = S.Orientation();
#endif
TNaming_Builder B(L);
TDF_LabelMap Forbiden;
-#ifdef BUC60925
if(!ValidArgs(Args)) return Standard_False;
-#endif
TNaming_NamingTool::BuildDescendants (Stop, Forbiden); //all descendants of Stop (New shapes) are forbidden
if (!Stop.IsNull()) Forbiden.Remove(Stop->Label());
//----------------------------------------
#include <Standard.hxx>
#include <TNaming_CopyShape.hxx>
-#define BUC60921 //SRN 15/05/01 : Fixes the memory leak due to pointer to RefShape is not deleted
//#define MDTV_DEB_HASL
//=======================================================================
//function : GetID
// le shape disparait
if (MapExist)
M.UnBind(pos->Shape());
- //#ifdef BUC60921
N->myOld = 0L;
if(pos != N->myNew)
{
delete pos;
pos = 0L;
}
- //#endif
}
}
else {
typedef NCollection_DataMap<TopoDS_Shape, TNaming_MapOfShape> TNaming_DataMapOfShapeMapOfShape;
typedef TNaming_DataMapOfShapeMapOfShape::Iterator TNaming_DataMapIteratorOfDataMapOfShapeMapOfShape;
// The bug concerns access to a null object in the method Filter():
-#define BUC60847
-#define OCC273
-#define OCC350
-#define OCC352
#define ALLOW_CHILD_NBS
//#define MDTV_DEB_CC
//#define MDTV_DEB_OR
return 1;
}
-#ifdef OCC350
-
//=======================================================================
//function : GetShapeEvolutions
//purpose : returns Standard_True, if target has parent in source; list contains inheritance chain
}
return aResult;
}
-#endif
//=======================================================================
static Standard_Boolean FillSMap(const TopoDS_Shape& S, TopTools_MapOfShape& MS)
Write(S, "TSol_S.brep");
Write(Res, "TSol_Res.brep");
#endif
-#ifdef OCC352
if ((S.ShapeType() == TopAbs_FACE ||
S.ShapeType() == TopAbs_EDGE ||
return aMS.IsEmpty();
} else {
-#else
-
- if (S.ShapeType() == TopAbs_SOLID ||
- S.ShapeType() == TopAbs_FACE ||
- S.ShapeType() == TopAbs_EDGE ||
- S.ShapeType() == TopAbs_VERTEX ) {
- return (Res.IsSame(S));
- }
- else {
-
-#endif
-
TopTools_MapOfShape MS;
Standard_Boolean isHom = FillSMap(S, MS);
TopAbs_ShapeEnum aType(TopAbs_SHAPE);
Write(S, "FNBS_S.brep");
Write(Neighbourg, "NBS");
#endif
-#ifdef OCC273
// mpv : NS and shape must be the same
Standard_Boolean isIn = Standard_False;
TNaming_Iterator anIter(NS);
}
if (!isIn) if (!TNaming_Tool::NamedShape(S,F).IsNull()) NS = TNaming_Tool::NamedShape(S,F);
// if (!TNaming_Tool::NamedShape(S,F).IsNull()) NS = TNaming_Tool::NamedShape(S,F);
-#endif
if (Neighbourg.IsEmpty()) {
// Recherche du vrai context. (Research of context truth)
Handle(TNaming_NamedShape) GenS = TNaming_Tool::NamedShape(S,NS->Label());
-#ifdef BUC60847
if (GenS.IsNull()) return Standard_False;
-#endif
TDF_Label Father = (GenS->Label()).Father();
Father.FindAttribute(TNaming_NamedShape::GetID(),GenS);
TopoDS_Shape GoodContext = TNaming_Tool::GetShape(GenS);
// pour construire le nom correspondant a S.
//-------------------------------------------------
-#ifdef OCC273
if(NS.IsNull()) return NS;
-#endif
TNaming_Localizer Localizer;
TNaming_Iterator itNS(NS);
// Check + Filtre
//----------------
-#ifdef OCC350
-
Standard_Boolean StandardFilter = !IsGeneration;
if (IsGeneration) {
if (!CompareInGeneration (NS,Selection)) {
if (StandardFilter) if (!Compare (NS,MDF,Stop,Selection)) {
Filter (F,MDF,Selection,Context,Localizer,NS,0);
}
-
-#else
-
- if (IsGeneration) {
- if (!CompareInGeneration (NS,Selection)) {
- TopoDS_Shape NewContext;
- Handle(TNaming_NamedShape) NewStop;
- FindNewShapeInFather (Ident.NamedShapeOfGeneration(),NewContext);
- Filter (F,MDF,Selection,NewContext,Localizer,NS,0);
- }
- }
- else {
- if (!Compare (NS,MDF,Stop,Selection))
- Filter (F,MDF,Selection,Context,Localizer,NS,0);
- }
-
-#endif
-
}
}
if (MDF.WithValid()) MDF.Valid(NS->Label());
BuildScope (MDF,Context,F);
Handle(TNaming_NamedShape) Stop;
-#ifdef OCC352
if ((S.ShapeType() == TopAbs_SOLID && !TNaming_Tool::NamedShape(S,F).IsNull()) ||
-#else
-
- if (S.ShapeType() == TopAbs_SOLID ||
-
-#endif
-
S.ShapeType() == TopAbs_FACE ||
S.ShapeType() == TopAbs_EDGE ||
S.ShapeType() == TopAbs_VERTEX ) {
if(S.ShapeType() != TopAbs_WIRE)
theName.Type(TNaming_UNION);
-#ifdef OCC352
TopAbs_ShapeEnum atomType;
switch (S.ShapeType()) {
case TopAbs_COMPSOLID:
}
}
}
-#else
- for (TopoDS_Iterator it(S) ; it.More(); it.Next()) {
- theName.Append(BuildName (Naming->Label(),MDF,it.Value(),Context,Stop,Geom));
- }
-#endif
//Naming->Update();
Naming->GetName().Solve(Naming->Label(),MDF.GetValid());
Naming->Label().FindAttribute(TNaming_NamedShape::GetID(),NS);
if (Geom) return NS;
-#ifdef OCC273
if(NS.IsNull()) return BuildNS (F,S, TNaming_UNKNOWN);
-#endif
if (!Geom && TestSolution(MDF,NS,S)) return NS;
}
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS_Iterator.hxx>
-#define BUC60862
-#define OCC273
-#define OCC351
//#define MDTV_DEB_SEL
#ifdef OCCT_DEBUG_SEL
else {
NS = Ident.FeatureArg();
-#ifdef OCC273
// mpv : external condition
TDF_LabelMap Forbiden,Valid;
TopTools_MapOfShape MS;
TNaming_NamingTool::CurrentShape(Valid,Forbiden,NS,MS);
return (MS.Contains(Selection) && MS.Extent() == 1);
-#else
- return Standard_True;
-#endif
}
}
else if(Ident.Type() == TNaming_GENERATION) {
// namedshape with SELECTED Evolution
//
TNaming_Builder B (myLabel);
-#ifdef OCC351
// mpv: if oldShape for selection is some shape from used map of shapes,
// then naming structure becomes more complex, can be cycles
const TopoDS_Shape& aSelection = TNaming_Tool::CurrentShape(NS); //szy
B.Select(aSelection,aSelection); // type migration
else
B.Select(Selection,Selection);
-#else
- B.Select(Selection,Context);
-#endif
//
// naming with IDENTITY NameType
//
N->ChangeName().Type(TNaming_IDENTITY);
N->ChangeName().Append(NS);
N->ChangeName().Orientation(Selection.Orientation());
-#ifdef BUC60862
// inserted by vro 06.09.00:
N->ChangeName().ShapeType(Selection.ShapeType());
-#endif
myLabel.AddAttribute(N);
return Standard_True;
#include <TopoDS_Iterator.hxx>
#include <TopExp_Explorer.hxx>
-#define BUC60862
//#define MDTV_DEB_INT
//=======================================================================
//function : TNaming_ShapesSet
}
else {
-#ifdef BUC60862
// corrected by vro 13.09.00:
if (Type > CS.ShapeType()) {
for (TopExp_Explorer exp(CS,Type) ; exp.More(); exp.Next()) {
Add(CS);
}
// end of correction by vro.
-#else
- for (TopExp_Explorer exp(CS,Type) ; exp.More(); exp.Next()) {
- Add(exp.Current());
- }
-#endif
-
}
}
#include <Standard_NoSuchObject.hxx>
-#define BUC60862
-
-#ifdef BUC60862
#include <TNaming_Naming.hxx>
#include <TNaming_ListOfNamedShape.hxx>
#include <TDF_AttributeMap.hxx>
#include <TDF_ChildIterator.hxx>
#include <TopExp_Explorer.hxx>
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
-#endif
//=======================================================================
//function : LastModif
#endif
-#ifdef BUC60862
//=======================================================================
//function : FindShape
//purpose : ANaming
#endif
}
-#endif
#include <TNaming_DataMapIteratorOfDataMapOfShapePtrRefShape.hxx>
#include <TNaming_RefShape.hxx>
#include <TNaming_PtrNode.hxx>
-#define BUC60862
-#ifdef BUC60862
#include <TopoDS_Shape.hxx>
-#endif
-
-#define BUC60921 //SRN 15/05/01 : Fixes the memory leak due to pointer to RefShape is not deleted
//=======================================================================
//function : GetID
void TNaming_UsedShapes::BeforeRemoval()
{
-#ifdef BUC60921
Destroy();
-#else
- myMap.Clear();
-#endif
}
Standard_OStream& TNaming_UsedShapes::Dump(Standard_OStream& anOS) const
{
-#ifdef BUC60862
anOS<<"The content of UsedShapes attribute:"<<endl;
TNaming_DataMapIteratorOfDataMapOfShapePtrRefShape itr(myMap);
for (; itr.More(); itr.Next()) {
anOS << " Value_TShape = " <<itr.Value()->Shape().TShape()->This();
anOS<<endl;
}
-#endif
return anOS;
}
#include <TPrsStd_Driver.hxx>
#include <TPrsStd_DriverTable.hxx>
-
-#define BUC60917
-#define BUC61050
-
-#define OCC1029
-#define OCC1030
-#define OCC1031
-#define OCC1032
-#define OCC1033
-#define OCC1034
-
//=======================================================================
//function : Set
//purpose :
myColor(Quantity_NOC_WHITE),
myMaterial(Graphic3d_NOM_BRASS),
myWidth(0.),
-#ifdef BUC61050
myMode(0),
mySelectionMode(0),
-#endif
isDisplayed(Standard_False),
hasOwnColor(Standard_False),
hasOwnMaterial(Standard_False),
hasOwnTransparency(Standard_False),
-hasOwnWidth(Standard_False)
-#ifdef BUC61050
-,hasOwnMode(Standard_False),
+hasOwnWidth(Standard_False),
+hasOwnMode(Standard_False),
hasOwnSelectionMode(Standard_False)
-#endif
{}
}
}
-#ifdef BUC61050
//=======================================================================
//function : SelectionMode
//purpose :
myAIS->UnsetSelectionMode();
}
}
-#endif
-
//=======================================================================
//function : ID
copy->myTransparency = myTransparency;
copy->myColor = myColor;
copy->myMode= myMode;
-#ifdef BUC60917
copy->myWidth= myWidth;
-#endif
copy->myMaterial = myMaterial;
copy->hasOwnColor = hasOwnColor;
copy->hasOwnMaterial = hasOwnMaterial;
copy->myAIS.Nullify();
copy->isDisplayed = isDisplayed;
copy->myDriverGUID = myDriverGUID;
-#ifdef BUC61050
copy->mySelectionMode= mySelectionMode;
copy->hasOwnSelectionMode = hasOwnSelectionMode;
-#endif
return copy;
}
if(!with->HasOwnMaterial()) hasOwnMaterial = Standard_False;
else {
-#ifndef OCC1031
- myMaterial = with->Material();
-#endif
hasOwnMaterial = Standard_True;
}
-#ifdef OCC1031
myMaterial = with->Material();
-#endif
if(!with->HasOwnColor()) hasOwnColor = Standard_False;
else {
-#ifndef OCC1030
- myColor = with->Color();
-#endif
hasOwnColor = Standard_True;
}
-#ifdef OCC1030
myColor = with->Color();
-#endif
if(!with->HasOwnWidth()) hasOwnWidth = Standard_False;
else {
-#ifndef OCC1032
- myWidth = with->Width();
-#endif
hasOwnWidth = Standard_True;
}
-#ifdef OCC1032
myWidth = with->Width();
-#endif
if(!with->HasOwnMode()) hasOwnMode = Standard_False;
else {
-#ifndef OCC1033
- myMode = with->Mode();
-#endif
hasOwnMode = Standard_True;
}
-#ifdef OCC1033
myMode = with->Mode();
-#endif
-#ifdef BUC61050
if(!with->HasOwnSelectionMode()) hasOwnSelectionMode = Standard_False;
else {
-#ifndef OCC1034
- mySelectionMode = with->SelectionMode();
-#endif
hasOwnSelectionMode = Standard_True;
}
-#ifdef OCC1034
mySelectionMode = with->SelectionMode();
-#endif
-#endif
if(!with->HasOwnTransparency()) hasOwnTransparency = Standard_False;
else {
-#ifndef OCC1029
- myTransparency = with->Transparency();
-#endif
hasOwnTransparency = Standard_True;
}
-#ifdef OCC1029
myTransparency = with->Transparency();
-#endif
isDisplayed = with->IsDisplayed();
myDriverGUID = with->GetDriverGUID();
into->hasOwnMode = Standard_True;
}
-#ifdef BUC61050
if(!hasOwnSelectionMode) into->hasOwnSelectionMode = Standard_False;
else {
into->mySelectionMode = mySelectionMode;
into->hasOwnSelectionMode = Standard_True;
}
-#endif
if(!hasOwnTransparency) into->hasOwnTransparency = Standard_False;
else {
}
-#ifdef BUC61050
if (hasOwnSelectionMode) {
if (myAIS->SelectionMode() != mySelectionMode ) {
myAIS->SetSelectionMode(mySelectionMode);
}
}
-#endif
}
#include <TopTools_IndexedMapOfShape.hxx>
-#define BUC60846
-
static Standard_Boolean CheckShapesPair(const TopoDS_Shape& , const TopoDS_Shape& ); //ota
//=======================================================================
// Modified Mon Apr 7 16:52:40 1997 by Patrick BOSINCO
// Add Dimensions access methods
-#define PRO8619 //GG_160697
// Convertir correctement les unites translatees
#include <stdlib.h>
lastdimension = token->Dimensions();
}
dim = lastdimension;
-#ifdef PRO8619
return (aData + lastmove) * lastvalue;
-#else
- return aData * lastvalue;
-#endif
}
lastdimension = token->Dimensions();
}
dim = lastdimension;
-#ifdef PRO8619
return (aData / lastvalue) - lastmove;
-#else
- return aData / lastvalue;
-#endif
}
#include <Units_ShiftedToken.ixx>
#include <TCollection_AsciiString.hxx>
-#define XTRACE 1
-
//=======================================================================
//function : Units_ShiftedToken
//purpose :
: Units_Token(aword,amean,avalue,adimensions)
{
themove = amove;
-#ifdef TRACE
- cout << " CREATES ShiftedToken " << endl;
- Dump(0,0);
-#endif
}
//=======================================================================
void Units_ShiftedToken::Destroy () {
-#ifdef TRACE
- cout << " DESTROIES ShiftedToken " << endl;
- Dump(0,0);
-#endif
}
// due to inline use probably.
// See also Units_Token.lxx
-#define PRO8727 //GG_180697
// Mauvaise construction d'un token par copie
// plantatoire sur HP.
#include <TCollection_AsciiString.hxx>
#include <Units_Operators.hxx>
-#define XTRACE 1
-
//=======================================================================
//function : Units_Token
//purpose :
themean=" ";
thevalue=0.;
thedimensions=new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.);
-#ifdef TRACE
- cout << " CREATES Token " << endl;
- Dump(0,0);
-#endif
}
//=======================================================================
themean=" ";
thevalue=0.;
thedimensions=new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.);
-#ifdef TRACE
- cout << " CREATES Token " << endl;
- Dump(0,0);
-#endif
}
//=======================================================================
themean=amean;
thevalue=0.;
thedimensions=new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.);
-#ifdef TRACE
- cout << " CREATES Token " << endl;
- Dump(0,0);
-#endif
}
//=======================================================================
themean=amean;
thevalue=avalue;
thedimensions=new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.);
-#ifdef TRACE
- cout << " CREATES Token " << endl;
- Dump(0,0);
-#endif
}
//=======================================================================
adimensions->LuminousIntensity(),
adimensions->PlaneAngle(),
adimensions->SolidAngle());
-#ifdef TRACE
- cout << " CREATES Token " << endl;
- Dump(0,0);
-#endif
}
//=======================================================================
Handle(Units_Token) Units_Token::Creates() const
{
-#ifdef PRO8727
TCollection_AsciiString word = Word();
TCollection_AsciiString mean = Mean();
return new Units_Token(word.ToCString(),mean.ToCString(),Value(),Dimensions());
-#else
- return new Units_Token(*this);
-#endif
}
//=======================================================================
void Units_Token::Destroy () {
-#ifdef TRACE
- cout << " DESTROIES Token" << endl;
- Dump(0,0);
-#endif
}
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define PRO8619 //GG_160697
// Convertir correctement les unites translatees
#include <Units_UnitsSystem.ixx>
}
Handle(Units_Token) token = unitsentence.Evaluate();
-#ifdef PRO8619
if( token->IsKind(STANDARD_TYPE(Units_ShiftedToken)) ) {
Handle(Units_ShiftedToken) stoken =
Handle(Units_ShiftedToken)::DownCast(token) ;
unit = sunit = new Units_ShiftedUnit(aunit,aunit);
sunit->Value(stoken->Value());
sunit->Move(stoken->Move());
- } else
-#endif
- {
+ } else {
unit = new Units_Unit(aunit,aunit);
unit->Value(token->Value());
}
if(activeunit) {
unitssequence = quantity->Sequence();
unit = unitssequence->Value(activeunit);
-#ifdef PRO8619
if( unit->IsKind(STANDARD_TYPE(Units_ShiftedUnit)) ) {
sunit = Handle(Units_ShiftedUnit)::DownCast(unit) ;
uvalue = sunit->Value();
return avalue/uvalue - umove;
}
else
-#endif
{
uvalue = unit->Value();
return avalue/uvalue;
if(activeunit) {
unitssequence = quantity->Sequence();
unit = unitssequence->Value(activeunit);
-#ifdef PRO8619
if( unit->IsKind(STANDARD_TYPE(Units_ShiftedUnit)) ) {
sunit = Handle(Units_ShiftedUnit)::DownCast(unit) ;
uvalue = sunit->Value();
umove = sunit->Move();
return avalue*(uvalue + umove);
} else
-#endif
{
uvalue = unit->Value();
return avalue*uvalue;
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
--- Updated: GG IMP230300 The color fields are moved in Aspect_Grid
-
private class CircularGrid from V3d inherits CircularGrid from Aspect
uses
VERSION HISTORY :
--------------------------------
- IMP230300: GG The color fields and methods have moved in Aspect_Grid
-
************************************************************************/
-#define IMP200100 //GG
-// -> Compute the case Aspect_GDM_None
-// -> Initialize the grid size according to the
-// viewer default size.
-
-#define IMP200300 //GG
-// -> Recompute the grid when any graphic parameter is
-// modified.
-
-#define IMP300300 //GG
-// -> Draw circles with 2 colors (tenth and normal colors)
-
/*----------------------------------------------------------------------*/
/*
* Includes
-- Update: FDA Oct 15 1994
-- ZOV - Mars 30 1998
--- GG IMP230300 Add SetColor() and Color() methods
-- GG - 23/11/00 Add IsDisplayed() method
HISTORIQUE DES MODIFICATIONS :
--------------------------------
00-09-92 : GG ; Creation.
- 30-03-98 : ZOV ; PRO6774 (reconstruction of the class hierarchy and suppressing useless methods)
- IMP230300: GG Add SetColor() and Color() methods
- IMP231100: GG Add IsDisplayed() method
************************************************************************/
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
--- Updated: GG IMP230300 The color fields have moved Aspect_Grid
-
private class RectangularGrid from V3d inherits RectangularGrid from Aspect
uses
13-10-98 : CAL ; S3892. Ajout de la gestion de la taille des grilles 3d.
23-10-98 : CAL ; PRO 15885. Patch K4403 et K4404
03-11-98 : CAL ; PRO 16161. Patch K4418 et K4419
- IMP230300: GG The color fields and methods have moved in Aspect_Grid
-
************************************************************************/
-#define IMP200100 //GG
-// -> Compute the case Aspect_GDM_None
-// -> Initialize the grid size according to the
-// viewer default size.
-
-#define IMP200300 //GG
-// -> Recompute the grid when any graphic parameter is
-// modified.
-
/*----------------------------------------------------------------------*/
/*
* Includes
-- commercial license or contractual agreement.
-- Modified: FMN - 24/12/97 -> Suppression GEOMLITE
--- CQO - 24/12/97 -> BUC50037
-- stt:25-02-98; S3558: ajout IfManageStandardEvent
-- stt:08-04-98; suppr IfManageStandardEvent
-- CAL - 18/08/98 -> S3892. Ajout grilles 3d.
-- TypeOfTriedron* from Aspect(et pas V3d)
-- CAL - 21/10/98 -> Speciale. Ajout methode Tumble.
-- 29-OCT-98 : DCB : Adding ScreenCopy () method.
--- GG - 10/11/99 : PRO19603 Adding Redraw( area ) method
--- GG - 15/12/99 : GER61351 Adding SetBackgroundColor()
--- and BackgroundColor() methods
-- GG - 24/01/00 : -> Remove internal PixToRef() method, use Convert()
-- method instead.
-- -> Rename internal RefToPix() to Convert() method.
-- -> Add method Dump()
-- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
-- -> Add Print method (works only under Windows).
--- GG - IMP231100
--- -> Add IsActiveLight() & IsActivePlane() methods
--- SZV - IMP100701
--- -> Add ToPixMap() method
--- GG - RIC120302 Add NEW SetWindow method.
-- SAV - 22/10/01
-- -> Add EnableDepthTest() & IsDepthTestEnabled().
-- VSV - 28/05/02: ZBUFFER mode of Trihedron
06-10-98 : CAL ; Ajout d'un TIMER si CSF_GraphicTimer est definie.
16-10-98 : CAL ; Retrait d'un TIMER si CSF_GraphicTimer est definie.
06-11-98 : CAL ; PRO ?????. Probleme dans ZFitAll si un point dans la vue.
-13-06-98 : FMN ; PRO14896: Correction sur la gestion de la perspective (cf Programming Guinde)
29-OCT-98 : DCB : Adding ScreenCopy () method.
-10-11-99 : GG ; PRO19603 Add Redraw( area ) method
-IMP130100 : GG
--> Don't increase too much the ZSize.
--> Initialize correctly the Z clipping and D cueing
-planes.
-IMP100701 : SZV ; Add ToPixMap() method
REMARQUES :
-----------
************************************************************************/
-//GER61351 //GG_15/12/99 Add SetBackgroundColor() and BackgroundColor() methods
-
-
-#define IMP020300 //GG Don't use ZFitAll in during Rotation
-// for perf improvment
-
-#define IMP210600 //GG Avoid to have infinite loop when call Rotation() method
-// without call before StartRotation().
-// This problem occurs when CTRL MB3 is maintain press betwwen 2 views.
-
-#define IMP250900 //GG Enable rotation around screen Z axis when
-// rotation begin far the center of the screen.
-// Thanks to Patrick REGINSTER (SAMTECH)
-// GG 21/12/00 Due to a regression on the previous specifications
-// this new functionnality is right now deactivated
-// by default (see StartRotation(...,zRotationThreshold)
-// method.
-
-#define BUC60952 //GG Enable to rotate around the view axis
-// and the required view point
-
-#define IMP260302 //GG To avoid conflicting in Window destructor
-// nullify this handle in Remove method
-
-#define OCC280 //SAV fix for FitAll problem in the perspective view.
-
-#define OCC1188 //SAV Added methods to set background image
-
/*----------------------------------------------------------------------*/
/*
* Includes
const Aspect_FillMethod FillStyle,
const Standard_Boolean update )
{
-#ifdef OCC1188
if( MyView->IsDefined() )
MyView->SetBackgroundImage( FileName, FillStyle, update ) ;
-#endif
}
//=============================================================================
void V3d_View::SetBgImageStyle( const Aspect_FillMethod FillStyle,
const Standard_Boolean update )
{
-#ifdef OCC1188
if( MyView->IsDefined() )
MyView->SetBgImageStyle( FillStyle, update ) ;
-#endif
}
//=============================================================================
//function : StartRotation
//purpose :
//=============================================================================
-#ifdef IMP250900
static Standard_Boolean zRotation = Standard_False;
-#endif
void V3d_View::StartRotation(const Standard_Integer X,
const Standard_Integer Y,
const Quantity_Ratio zRotationThreshold)
ry = Standard_Real(Convert(y));
Gravity(gx,gy,gz);
Rotate(0.,0.,0.,gx,gy,gz,Standard_True);
-#ifdef IMP250900
zRotation = Standard_False;
if( zRotationThreshold > 0. ) {
Standard_Real dx = Abs(sx - rx/2.);
Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
if( dx > dd || dy > dd ) zRotation = Standard_True;
}
-#endif
}
void V3d_View::Rotation(const Standard_Integer X,
const Standard_Integer Y)
{
-#ifdef IMP210600
if( rx == 0. || ry == 0. ) {
StartRotation(X,Y);
return;
}
-#endif
-#ifdef IMP250900
Standard_Real dx=0.,dy=0.,dz=0.;
if( zRotation ) {
dz = atan2(Standard_Real(X)-rx/2., ry/2.-Standard_Real(Y)) -
dy = (sy - Standard_Real(Y)) * M_PI / ry;
}
Rotate(dx, dy, dz, gx, gy, gz, Standard_False);
-#else
- Standard_Real dx = (Standard_Real(X - sx)) * M_PI;
- Standard_Real dy = (Standard_Real(sy - Y)) * M_PI;
- Rotate(dx/rx, dy/ry, 0., gx, gy, gz, Standard_False);
-#endif
-#ifdef IMP020300
if( !myImmediateUpdate ) Update();
-#else
- myImmediateUpdate = Standard_False;
- Rotate(dx/rx, dy/ry, 0., gx, gy, gz, Standard_False);
- ZFitAll (Zmargin); //Don't do that, perf improvment
- myImmediateUpdate = Standard_True;
- ImmediateUpdate();
-#endif
}
//=============================================================================
************************************************************************/
-#define GER61454 //GG 13-09-99 Activates model clipping planes
// Use myView->PlaneLimit() instead Visual3d_ClipPlane::Limit()
// Use myView->LightLimit() instead Visual3d_Light::Limit()
-
-
/*----------------------------------------------------------------------*/
/*
* Includes
void V3d_View::SetLightOn( const Handle(V3d_Light)& TheLight ) {
if( !MyActiveLights.Contains(TheLight)){
-#ifdef GER61454
V3d_BadValue_Raise_if( MyActiveLights.Extent() >= MyView->LightLimit(),
"too many lights");
-#else
-// V3d_BadValue_Raise_if( MyActiveLights.Extent() >= Visual3d_Light::Limit(),
-// "too many lights");
-#endif
MyActiveLights.Append(TheLight) ;
MyViewContext.SetLightOn(TheLight->Light());
MyView->SetContext(MyViewContext);
Standard_Boolean V3d_View::IfMoreLights() const {
-#ifdef GER61454
return MyActiveLights.Extent() < MyView->LightLimit();
-#else
-// return MyActiveLights.Extent() < Visual3d_Light::Limit();
- return MyActiveLights.Extent();
-#endif
}
//=======================================================================
-- Modified FMN - 02/02/98 -> Specifique UNIX
-- CAL - 16/07/98 -> S3892. Ajout grilles 3d.
--- GG - 15/12/99 -> GER61351 Add SetDefaultBackgroundColor()
--- and DefaultBackgroundColor() methods
--- GG - 20/01/00 -> IMP200100 Add GridDrawMode() method
--- GG - 24/01/00 -> IMP240100 Add SetGridEcho() methods
--- Add GridEcho() method.
--- Add ShowGridEcho() private method
-- SAV - 26/11/02 -> Add new field to store grid echo aspect
class Viewer from V3d inherits TShared from MMgt
************************************************************************/
-#define IMP240300 //GG
// -> Remove the grid plane axis when it is requested.
// -> Redraw the privilegied grid plane after any change
* Static variable
*/
-#define LOPTIM
-#ifndef LOPTIM
-static TCollection_AsciiString XLetter("X");
-static TCollection_AsciiString YLetter("Y");
-static TCollection_AsciiString ZLetter("Z");
-#else
static TCollection_AsciiString _XLetter() {
static TCollection_AsciiString XLetter("X");
return XLetter;
}
#define ZLetter _ZLetter()
-#endif // LOPTIM
-
/*----------------------------------------------------------------------*/
void V3d_Viewer::SetPrivilegedPlane(const gp_Ax3& aPlane)
-- TypeOfTriedronPosition.
-- 22-09-98; BGN: S3989 (anciennement S3819): report
-- dans Aspect des TypeOfTriedron*
--- 14-01-00; GG : IMP140100 Add ViewManager pointer
-- Purpose: Specifications definitives
package Visual3d
************************************************************************/
-#define BUC60572 //GG 03-08-99 Move Zcueing and Zclipping front & back planes
-// coherence checking in Visual3d_View::SetContext()
-
-
/*----------------------------------------------------------------------*/
/*
* Includes
void Visual3d_ContextView::SetZClippingFrontPlane (const Standard_Real AFront) {
-#ifndef BUC60572
- if ( (FrontZclippingIsActive) && (BackZclippingIsActive) &&
- (MyZclippingBackPlane >= AFront) )
- Visual3d_ZClippingDefinitionError::Raise
- ("Bad value for ZClippingFrontPlane");
-#endif
-
MyZclippingFrontPlane = Standard_ShortReal (AFront);
}
void Visual3d_ContextView::SetDepthCueingFrontPlane (const Standard_Real AFront) {
-#ifndef BUC60572
- if ( (ZcueingIsActive) && (MyDepthCueingBackPlane >= AFront) )
- Visual3d_DepthCueingDefinitionError::Raise
- ("Bad value for DepthCueingFrontPlane");
-#endif
-
MyDepthCueingFrontPlane = Standard_ShortReal (AFront);
}
void Visual3d_ContextView::SetZClippingBackPlane (const Standard_Real ABack) {
-#ifndef BUC60572
- if ( (FrontZclippingIsActive) && (FrontZclippingIsActive) &&
- (MyZclippingFrontPlane <= ABack) )
- Visual3d_ZClippingDefinitionError::Raise
- ("Bad value for ZClippingBackPlane");
-#endif
-
MyZclippingBackPlane = Standard_ShortReal (ABack);
}
void Visual3d_ContextView::SetDepthCueingBackPlane (const Standard_Real ABack) {
-#ifndef BUC60572
- if ( (ZcueingIsActive) && (MyDepthCueingFrontPlane <= ABack) )
- Visual3d_DepthCueingDefinitionError::Raise
- ("Bad value for DepthCueingBackPlane");
-#endif
-
MyDepthCueingBackPlane = Standard_ShortReal (ABack);
}
-- 22-09-98: BGN; S3989 (anciennement S3819)
-- TypeOfTriedron* from Aspect(et pas Visual3d)
-- 02-12-98: S4062. Ajout des layers.
--- 13-09-99: GG; GER61454 Adds LightLimit() and PlaneLimit() methods
--- 10-11-99: GG; Add PRO19603 Redraw( area ) method
--- 14-01-00: GG; Add IMP140100 ViewManager() method
-- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
-- -> Add Print methods (works only under Windows).-
-- GG - RIC120302 Add NEW SetWindow method.
void Visual3d_ViewManager::Destroy () {
-#ifdef DESTROY
- cout << "Visual3d_ViewManager::Destroy (" << MyId << ")\n" << flush;
-#endif
-
Remove ();
}
void Visual3d_ViewManager::Remove () {
-#ifdef DESTROY
- cout << "Visual3d_ViewManager::Remove (" << MyId << ")\n" << flush;
-#endif
-
//
// Destroy all defined views
//
-#ifdef DESTROY
- cout << "The Manager " << MyId << " have " << Length << " defined views\n";
- cout << flush;
-#endif
-
// clear all structures whilst views are alive for correct GPU memory management
MyDisplayedStructure.Clear();
MyHighlightedStructure.Clear();
void Visual3d_ViewManager::ChangeDisplayPriority (const Handle(Graphic3d_Structure)& AStructure, const Standard_Integer OldPriority, const Standard_Integer NewPriority)
{
-
-#ifdef TRACE
- cout << "Visual3d_ViewManager::ChangeDisplayPriority ("
- << AStructure->Identification ()
- << ", " << OldPriority << ", " << NewPriority << ")\n";
- cout << flush;
-#endif
-
//
// Change structure priority in all defined views
//
}
void Visual3d_ViewManager::SetLayer (const Handle(Visual3d_Layer)& ALayer) {
-
-#ifdef TRACE_LAYER
- cout << "Visual3d_ViewManager::SetLayer\n" << flush;
-#endif
-
if (ALayer->Type () == Aspect_TOL_OVERLAY) {
-#ifdef TRACE_LAYER
- if (MyOverLayer.IsNull ())
- cout << "MyOverLayer is defined" << endl;
- else
- cout << "MyOverLayer is redefined" << endl;
-#endif
MyOverLayer = ALayer;
}
else {
-#ifdef TRACE_LAYER
- if (MyUnderLayer.IsNull ())
- cout << "MyUnderLayer is defined" << endl;
- else
- cout << "MyUnderLayer is redefined" << endl;
-#endif
MyUnderLayer = ALayer;
}
IMPLEMENT_DOMSTRING (ExtString, "string")
IMPLEMENT_DOMSTRING (Value, "value")
-#define OCC6010
-
#ifdef WNT
#define EXCEPTION ...
#else
TCollection_AsciiString aValueStr2;
Standard_Integer j = anArr1.Lower();
for(;;) {
-#ifndef OCC6010
- aValueStr2 += TCollection_AsciiString(anArr1.Value(j));
-#else
char aValueChar[32];
Sprintf(aValueChar, "%.15g", anArr1.Value(j));
TCollection_AsciiString aValueStr(aValueChar);
aValueStr2 += aValueStr;
-#endif
if (j >= anArr1.Upper()) break;
aValueStr2 += ' ';
j++;
//AGV 150202: Changed prototype XmlObjMgt::SetStringValue()
-#define OCC6010 // vro 09.06.2004
-
#include <stdio.h>
#include <XmlMDataStd_RealDriver.ixx>
#include <TDataStd_Real.hxx>
XmlObjMgt_SRelocationTable& ) const
{
Handle(TDataStd_Real) anInt = Handle(TDataStd_Real)::DownCast(theSource);
-#ifndef OCC6010
- TCollection_AsciiString aValueStr (anInt->Get());
-#else
char aValueChar[32];
Sprintf(aValueChar, "%.17g", anInt->Get());
TCollection_AsciiString aValueStr(aValueChar);
-#endif
// No occurrence of '&', '<' and other irregular XML characters
XmlObjMgt::SetStringValue (theTarget, aValueStr.ToCString(), Standard_True);
}
#include <TPrsStd_AISPresentation.hxx>
-#define OCC6010 // vro: 09.06.2004
-
IMPLEMENT_DOMSTRING (GuidString, "guid")
IMPLEMENT_DOMSTRING (IsDisplayedString, "isdisplayed")
IMPLEMENT_DOMSTRING (ColorString, "color")
aTPrs->UnsetWidth();
}
-#ifdef OCC6010
// mode
aDOMStr = anElem.getAttribute(::ModeString());
if (aDOMStr != NULL)
{
aTPrs->UnsetMode();
}
-#endif
return Standard_True;
}