mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
OCC22272 Small improvements in selection and presentation
This commit is contained in:
parent
213cb88863
commit
bbf32d01fd
@ -50,8 +50,6 @@ uses
|
|||||||
HSequenceOfGroup from Graphic3d,
|
HSequenceOfGroup from Graphic3d,
|
||||||
SequenceOfStructure from Graphic3d,
|
SequenceOfStructure from Graphic3d,
|
||||||
HSequenceOfStructure from Graphic3d,
|
HSequenceOfStructure from Graphic3d,
|
||||||
SetOfGroup from Graphic3d,
|
|
||||||
HSetOfGroup from Graphic3d,
|
|
||||||
MapOfStructure from Graphic3d,
|
MapOfStructure from Graphic3d,
|
||||||
Plotter from Graphic3d,
|
Plotter from Graphic3d,
|
||||||
StructureManager from Graphic3d,
|
StructureManager from Graphic3d,
|
||||||
@ -62,7 +60,7 @@ uses
|
|||||||
Vector from Graphic3d,
|
Vector from Graphic3d,
|
||||||
VertexNC from Graphic3d,
|
VertexNC from Graphic3d,
|
||||||
Vertex from Graphic3d,
|
Vertex from Graphic3d,
|
||||||
TransModeFlags from Graphic3d,
|
TransModeFlags from Graphic3d,
|
||||||
Pnt from gp
|
Pnt from gp
|
||||||
|
|
||||||
raises
|
raises
|
||||||
@ -237,7 +235,7 @@ is
|
|||||||
ResetDisplayPriority ( me : mutable)
|
ResetDisplayPriority ( me : mutable)
|
||||||
is static;
|
is static;
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Reset the current priority of the structure to the
|
---Purpose: Reset the current priority of the structure to the
|
||||||
-- previous priority.
|
-- previous priority.
|
||||||
-- Category: Methods to modify the class definition
|
-- Category: Methods to modify the class definition
|
||||||
-- Warning: If <me> is displayed then the SetDisplayPriority
|
-- Warning: If <me> is displayed then the SetDisplayPriority
|
||||||
@ -495,10 +493,11 @@ is
|
|||||||
---Category: Inquire methods
|
---Category: Inquire methods
|
||||||
|
|
||||||
Groups ( me )
|
Groups ( me )
|
||||||
returns HSetOfGroup from Graphic3d
|
returns SequenceOfGroup from Graphic3d
|
||||||
is static;
|
is static;
|
||||||
|
---C++: return const &
|
||||||
---Level: Internal
|
---Level: Internal
|
||||||
---Purpose: Returns the set of groups included in the structure <me>.
|
---Purpose: Returns the groups sequence included in the structure <me> (internal storage).
|
||||||
---Category: Inquire methods
|
---Category: Inquire methods
|
||||||
|
|
||||||
NumberOfGroups ( me )
|
NumberOfGroups ( me )
|
||||||
@ -833,27 +832,27 @@ is
|
|||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Returns the transformation associated with
|
---Purpose: Returns the transformation associated with
|
||||||
-- the structure <me>.
|
-- the structure <me>.
|
||||||
---Category: Methods to manage the structure transformation
|
---Category: Methods to manage the structure transformation
|
||||||
|
|
||||||
SetTransformPersistence( me : mutable;
|
SetTransformPersistence( me : mutable;
|
||||||
AFlag : TransModeFlags from Graphic3d;
|
AFlag : TransModeFlags from Graphic3d;
|
||||||
APoint : Pnt from gp )
|
APoint : Pnt from gp )
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Modifies the current modelling transform persistence (pan, zoom or rotate)
|
---Purpose: Modifies the current modelling transform persistence (pan, zoom or rotate)
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
SetTransformPersistence( me : mutable;
|
SetTransformPersistence( me : mutable;
|
||||||
AFlag : TransModeFlags from Graphic3d )
|
AFlag : TransModeFlags from Graphic3d )
|
||||||
-- Calls previous method with point (0,0,0)
|
-- Calls previous method with point (0,0,0)
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
|
|
||||||
TransformPersistenceMode( me )
|
TransformPersistenceMode( me )
|
||||||
returns TransModeFlags from Graphic3d
|
returns TransModeFlags from Graphic3d
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Get the current modelling transform persistence (pan, zoom or rotate)
|
---Purpose: Get the current modelling transform persistence (pan, zoom or rotate)
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
TransformPersistencePoint( me )
|
TransformPersistencePoint( me )
|
||||||
returns Pnt from gp
|
returns Pnt from gp
|
||||||
---Level: Public
|
---Level: Public
|
||||||
@ -926,7 +925,7 @@ is
|
|||||||
AMatrix : Array2OfReal from TColStd )
|
AMatrix : Array2OfReal from TColStd )
|
||||||
is static;
|
is static;
|
||||||
---Level: Internal
|
---Level: Internal
|
||||||
---Purpose:
|
---Purpose:
|
||||||
---Category: Private methods
|
---Category: Private methods
|
||||||
|
|
||||||
GraphicUnHighlight ( me : mutable )
|
GraphicUnHighlight ( me : mutable )
|
||||||
|
@ -39,30 +39,30 @@
|
|||||||
// Ajout emission
|
// Ajout emission
|
||||||
// CAL : 20 mai 1998
|
// CAL : 20 mai 1998
|
||||||
// Perfs. Connection entre structures COMPUTED.
|
// Perfs. Connection entre structures COMPUTED.
|
||||||
// 30/11/98 ; FMN : S4069. Textes always visible.
|
// 30/11/98 ; FMN : S4069. Textes always visible.
|
||||||
// 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
|
// 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
|
||||||
|
|
||||||
#define G003 //EUG 26/01/00 Degeneration management
|
#define G003 //EUG 26/01/00 Degeneration management
|
||||||
|
|
||||||
#define BUC60918 //GG 31/05/01 A transparente structure priority must have the
|
#define BUC60918 //GG 31/05/01 A transparente structure priority must have the
|
||||||
// MAX_PRIORITY value so, the highlighted structure must have
|
// MAX_PRIORITY value so, the highlighted structure must have
|
||||||
// MAX_PRIORITY-1 value.
|
// MAX_PRIORITY-1 value.
|
||||||
// Add ResetDisplayPriority() method.
|
// Add ResetDisplayPriority() method.
|
||||||
|
|
||||||
#define OCC1174 // SAV 08/01/03 Added back face interior color controling
|
#define OCC1174 // SAV 08/01/03 Added back face interior color controling
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
//-Copyright MatraDatavision 1991,1992,1993,1994,1995
|
//-Copyright MatraDatavision 1991,1992,1993,1994,1995
|
||||||
|
|
||||||
//-Version
|
//-Version
|
||||||
|
|
||||||
//-Design Declaration of variables specific to graphic structures
|
//-Design Declaration of variables specific to graphic structures
|
||||||
|
|
||||||
//-Warning A structure is defined in a manager
|
//-Warning A structure is defined in a manager
|
||||||
// This is a sequence of groups of primitives
|
// This is a sequence of groups of primitives
|
||||||
|
|
||||||
//-References
|
//-References
|
||||||
|
|
||||||
//-Language C++ 2.0
|
//-Language C++ 2.0
|
||||||
|
|
||||||
@ -92,9 +92,9 @@
|
|||||||
#include <TColStd_Array2OfReal.hxx>
|
#include <TColStd_Array2OfReal.hxx>
|
||||||
#include <Graphic3d_TextureMap.hxx>
|
#include <Graphic3d_TextureMap.hxx>
|
||||||
|
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
#include <Aspect_PolygonOffsetMode.hxx>
|
#include <Aspect_PolygonOffsetMode.hxx>
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
|
|
||||||
//-Aliases
|
//-Aliases
|
||||||
|
|
||||||
@ -127,10 +127,10 @@ MyHighlightColor (Quantity_NOC_WHITE)
|
|||||||
AManager->PrimitivesAspect (aAspectLine3d, aAspectText3d,
|
AManager->PrimitivesAspect (aAspectLine3d, aAspectText3d,
|
||||||
aAspectMarker3d, aAspectFillArea3d);
|
aAspectMarker3d, aAspectFillArea3d);
|
||||||
|
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
// It is necessary to set default polygon offsets for a new presentation
|
// It is necessary to set default polygon offsets for a new presentation
|
||||||
aAspectFillArea3d->SetPolygonOffsets( Aspect_POM_Fill, 1., 0. );
|
aAspectFillArea3d->SetPolygonOffsets( Aspect_POM_Fill, 1., 0. );
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
|
|
||||||
// Update the associated CStructure
|
// Update the associated CStructure
|
||||||
UpdateStructure (aAspectLine3d, aAspectText3d,
|
UpdateStructure (aAspectLine3d, aAspectText3d,
|
||||||
@ -208,7 +208,7 @@ void Graphic3d_Structure::Destroy () {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// as MyFirstPtrStructureManager can be already destroyed,
|
// as MyFirstPtrStructureManager can be already destroyed,
|
||||||
// avoid attempts to access it
|
// avoid attempts to access it
|
||||||
MyFirstPtrStructureManager = 0;
|
MyFirstPtrStructureManager = 0;
|
||||||
Remove ();
|
Remove ();
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ void Graphic3d_Structure::Remove () {
|
|||||||
// Destruction of me in the graphic library
|
// Destruction of me in the graphic library
|
||||||
MyGraphicDriver->RemoveStructure (MyCStructure);
|
MyGraphicDriver->RemoveStructure (MyCStructure);
|
||||||
|
|
||||||
// Liberation of the identification if the destroyed structure
|
// Liberation of the identification if the destroyed structure
|
||||||
// in the first manager that performs creation of the structure.
|
// in the first manager that performs creation of the structure.
|
||||||
if ( MyFirstPtrStructureManager )
|
if ( MyFirstPtrStructureManager )
|
||||||
MyFirstStructureManager->Remove (Standard_Integer (MyCStructure.Id));
|
MyFirstStructureManager->Remove (Standard_Integer (MyCStructure.Id));
|
||||||
@ -594,7 +594,7 @@ Standard_Boolean Graphic3d_Structure::IsEmpty () const {
|
|||||||
if (IsDeleted ()) return (Standard_True);
|
if (IsDeleted ()) return (Standard_True);
|
||||||
|
|
||||||
// A structure is empty :
|
// A structure is empty :
|
||||||
// if all these groups are empty or if all
|
// if all these groups are empty or if all
|
||||||
// groups are empty and all their descendants
|
// groups are empty and all their descendants
|
||||||
// are empty or if all its descendants are empty.
|
// are empty or if all its descendants are empty.
|
||||||
|
|
||||||
@ -612,7 +612,7 @@ Standard_Boolean Graphic3d_Structure::IsEmpty () const {
|
|||||||
|
|
||||||
Length = MyDescendants.Length ();
|
Length = MyDescendants.Length ();
|
||||||
|
|
||||||
// Stop at the first non-empty descendant
|
// Stop at the first non-empty descendant
|
||||||
for (i=1; i<=Length && Result2; i++)
|
for (i=1; i<=Length && Result2; i++)
|
||||||
Result2 = ((Graphic3d_Structure *)
|
Result2 = ((Graphic3d_Structure *)
|
||||||
(MyDescendants.Value (i)))->IsEmpty ();
|
(MyDescendants.Value (i)))->IsEmpty ();
|
||||||
@ -889,8 +889,8 @@ Handle(Graphic3d_AspectFillArea3d) Graphic3d_Structure::FillArea3dAspect () cons
|
|||||||
|
|
||||||
Back.SetEnvReflexion (MyCStructure.ContextFillArea.Back.EnvReflexion);
|
Back.SetEnvReflexion (MyCStructure.ContextFillArea.Back.EnvReflexion);
|
||||||
|
|
||||||
Graphic3d_TypeOfMaterial mType =
|
Graphic3d_TypeOfMaterial mType =
|
||||||
MyCStructure.ContextFillArea.Back.IsPhysic ?
|
MyCStructure.ContextFillArea.Back.IsPhysic ?
|
||||||
Graphic3d_MATERIAL_PHYSIC : Graphic3d_MATERIAL_ASPECT;
|
Graphic3d_MATERIAL_PHYSIC : Graphic3d_MATERIAL_ASPECT;
|
||||||
Back.SetMaterialType(mType);
|
Back.SetMaterialType(mType);
|
||||||
|
|
||||||
@ -983,41 +983,28 @@ Graphic3d_MATERIAL_PHYSIC : Graphic3d_MATERIAL_ASPECT;
|
|||||||
CTXF->SetTextureMapOff ();
|
CTXF->SetTextureMapOff ();
|
||||||
#ifdef G003
|
#ifdef G003
|
||||||
Aspect_TypeOfDegenerateModel dMode = Aspect_TypeOfDegenerateModel(
|
Aspect_TypeOfDegenerateModel dMode = Aspect_TypeOfDegenerateModel(
|
||||||
MyCStructure.ContextFillArea.DegenerationMode);
|
MyCStructure.ContextFillArea.DegenerationMode);
|
||||||
Quantity_Ratio dRatio =
|
Quantity_Ratio dRatio =
|
||||||
MyCStructure.ContextFillArea.SkipRatio;
|
MyCStructure.ContextFillArea.SkipRatio;
|
||||||
CTXF->SetDegenerateModel(dMode,dRatio);
|
CTXF->SetDegenerateModel(dMode,dRatio);
|
||||||
#endif // G003
|
#endif // G003
|
||||||
|
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
CTXF->SetPolygonOffsets(MyCStructure.ContextFillArea.PolygonOffsetMode,
|
CTXF->SetPolygonOffsets(MyCStructure.ContextFillArea.PolygonOffsetMode,
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetFactor,
|
MyCStructure.ContextFillArea.PolygonOffsetFactor,
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetUnits);
|
MyCStructure.ContextFillArea.PolygonOffsetUnits);
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
|
|
||||||
return CTXF;
|
return CTXF;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Graphic3d_HSetOfGroup) Graphic3d_Structure::Groups () const {
|
const Graphic3d_SequenceOfGroup& Graphic3d_Structure::Groups() const {
|
||||||
|
return MyGroups;
|
||||||
Handle (Graphic3d_HSetOfGroup) SG = new Graphic3d_HSetOfGroup ();
|
|
||||||
|
|
||||||
if (IsDeleted ()) return (SG);
|
|
||||||
|
|
||||||
Standard_Integer i, Length = MyGroups.Length ();
|
|
||||||
|
|
||||||
for (i=1; i<=Length; i++)
|
|
||||||
SG->Add (MyGroups.Value (i));
|
|
||||||
|
|
||||||
return (SG);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Graphic3d_Structure::NumberOfGroups () const {
|
Standard_Integer Graphic3d_Structure::NumberOfGroups () const {
|
||||||
|
|
||||||
return (MyGroups.Length ());
|
return (MyGroups.Length ());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX) {
|
void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX) {
|
||||||
@ -1042,8 +1029,8 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectLine
|
|||||||
MyGraphicDriver->ContextStructure (MyCStructure);
|
MyGraphicDriver->ContextStructure (MyCStructure);
|
||||||
|
|
||||||
// CAL 14/04/95
|
// CAL 14/04/95
|
||||||
// attributes are "IsSet" during the first update
|
// Attributes are "IsSet" during the first update
|
||||||
// of a context (line, marker...)
|
// of context (line, marker...)
|
||||||
MyCStructure.ContextLine.IsSet = 1;
|
MyCStructure.ContextLine.IsSet = 1;
|
||||||
MyCStructure.ContextFillArea.IsSet = 1;
|
MyCStructure.ContextFillArea.IsSet = 1;
|
||||||
MyCStructure.ContextMarker.IsSet = 1;
|
MyCStructure.ContextMarker.IsSet = 1;
|
||||||
@ -1093,7 +1080,7 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectFill
|
|||||||
MyCStructure.ContextFillArea.Hatch = int (CTX->HatchStyle ());
|
MyCStructure.ContextFillArea.Hatch = int (CTX->HatchStyle ());
|
||||||
#ifdef G003
|
#ifdef G003
|
||||||
Quantity_Ratio ratio;
|
Quantity_Ratio ratio;
|
||||||
MyCStructure.ContextFillArea.DegenerationMode =
|
MyCStructure.ContextFillArea.DegenerationMode =
|
||||||
int (CTX->DegenerateModel(ratio));
|
int (CTX->DegenerateModel(ratio));
|
||||||
MyCStructure.ContextFillArea.SkipRatio = float (ratio);
|
MyCStructure.ContextFillArea.SkipRatio = float (ratio);
|
||||||
#endif // G003
|
#endif // G003
|
||||||
@ -1133,7 +1120,7 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectFill
|
|||||||
Standard_Boolean amt = ama.MaterialType(Graphic3d_MATERIAL_PHYSIC) ;
|
Standard_Boolean amt = ama.MaterialType(Graphic3d_MATERIAL_PHYSIC) ;
|
||||||
MyCStructure.ContextFillArea.Back.IsPhysic = ( amt ? 1 : 0 );
|
MyCStructure.ContextFillArea.Back.IsPhysic = ( amt ? 1 : 0 );
|
||||||
|
|
||||||
// Specular Color
|
// Specular Color
|
||||||
MyCStructure.ContextFillArea.Back.ColorSpec.r =
|
MyCStructure.ContextFillArea.Back.ColorSpec.r =
|
||||||
float (((CTX->BackMaterial ()).SpecularColor ()).Red ());
|
float (((CTX->BackMaterial ()).SpecularColor ()).Red ());
|
||||||
MyCStructure.ContextFillArea.Back.ColorSpec.g =
|
MyCStructure.ContextFillArea.Back.ColorSpec.g =
|
||||||
@ -1165,7 +1152,7 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectFill
|
|||||||
MyCStructure.ContextFillArea.Back.ColorEms.b =
|
MyCStructure.ContextFillArea.Back.ColorEms.b =
|
||||||
float (((CTX->BackMaterial ()).EmissiveColor ()).Blue ());
|
float (((CTX->BackMaterial ()).EmissiveColor ()).Blue ());
|
||||||
|
|
||||||
MyCStructure.ContextFillArea.Back.EnvReflexion =
|
MyCStructure.ContextFillArea.Back.EnvReflexion =
|
||||||
float ((CTX->BackMaterial ()).EnvReflexion());
|
float ((CTX->BackMaterial ()).EnvReflexion());
|
||||||
|
|
||||||
/*** Front Material ***/
|
/*** Front Material ***/
|
||||||
@ -1231,7 +1218,7 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectFill
|
|||||||
MyCStructure.ContextFillArea.Front.ColorEms.b =
|
MyCStructure.ContextFillArea.Front.ColorEms.b =
|
||||||
float (((CTX->FrontMaterial ()).EmissiveColor ()).Blue ());
|
float (((CTX->FrontMaterial ()).EmissiveColor ()).Blue ());
|
||||||
|
|
||||||
MyCStructure.ContextFillArea.Front.EnvReflexion =
|
MyCStructure.ContextFillArea.Front.EnvReflexion =
|
||||||
float ((CTX->FrontMaterial ()).EnvReflexion());
|
float ((CTX->FrontMaterial ()).EnvReflexion());
|
||||||
|
|
||||||
MyCStructure.ContextFillArea.IsDef = 1; // Definition material ok
|
MyCStructure.ContextFillArea.IsDef = 1; // Definition material ok
|
||||||
@ -1244,14 +1231,14 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectFill
|
|||||||
|
|
||||||
MyCStructure.ContextFillArea.Texture.doTextureMap = CTX->TextureMapState() ? 1:0;
|
MyCStructure.ContextFillArea.Texture.doTextureMap = CTX->TextureMapState() ? 1:0;
|
||||||
|
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
Standard_Integer aPolyMode;
|
Standard_Integer aPolyMode;
|
||||||
Standard_Real aPolyFactor, aPolyUnits;
|
Standard_Real aPolyFactor, aPolyUnits;
|
||||||
CTX->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits);
|
CTX->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits);
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetMode = aPolyMode;
|
MyCStructure.ContextFillArea.PolygonOffsetMode = aPolyMode;
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetFactor = aPolyFactor;
|
MyCStructure.ContextFillArea.PolygonOffsetFactor = aPolyFactor;
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetUnits = aPolyUnits;
|
MyCStructure.ContextFillArea.PolygonOffsetUnits = aPolyUnits;
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
|
|
||||||
MyGraphicDriver->ContextStructure (MyCStructure);
|
MyGraphicDriver->ContextStructure (MyCStructure);
|
||||||
#ifdef G003
|
#ifdef G003
|
||||||
@ -1302,9 +1289,9 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectText
|
|||||||
MyCStructure.ContextText.ColorSubTitle.r = float (Rs);
|
MyCStructure.ContextText.ColorSubTitle.r = float (Rs);
|
||||||
MyCStructure.ContextText.ColorSubTitle.g = float (Gs);
|
MyCStructure.ContextText.ColorSubTitle.g = float (Gs);
|
||||||
MyCStructure.ContextText.ColorSubTitle.b = float (Bs);
|
MyCStructure.ContextText.ColorSubTitle.b = float (Bs);
|
||||||
MyCStructure.ContextText.TextZoomable = ATextZoomable;
|
MyCStructure.ContextText.TextZoomable = ATextZoomable;
|
||||||
MyCStructure.ContextText.TextAngle = ATextAngle;
|
MyCStructure.ContextText.TextAngle = ATextAngle;
|
||||||
MyCStructure.ContextText.TextFontAspect = (int)ATextFontAspect;
|
MyCStructure.ContextText.TextFontAspect = (int)ATextFontAspect;
|
||||||
|
|
||||||
MyCStructure.ContextText.IsDef = 1;
|
MyCStructure.ContextText.IsDef = 1;
|
||||||
|
|
||||||
@ -1460,10 +1447,10 @@ void Graphic3d_Structure::Connect (const Handle(Graphic3d_Structure)& AStructure
|
|||||||
|
|
||||||
// connection
|
// connection
|
||||||
Standard_Integer i;
|
Standard_Integer i;
|
||||||
switch (AType)
|
switch (AType)
|
||||||
{
|
{
|
||||||
|
|
||||||
case Graphic3d_TOC_DESCENDANT :
|
case Graphic3d_TOC_DESCENDANT :
|
||||||
{
|
{
|
||||||
Standard_Integer indexD = 0;
|
Standard_Integer indexD = 0;
|
||||||
Standard_Integer LengthD = MyDescendants.Length ();
|
Standard_Integer LengthD = MyDescendants.Length ();
|
||||||
@ -1483,7 +1470,7 @@ void Graphic3d_Structure::Connect (const Handle(Graphic3d_Structure)& AStructure
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Graphic3d_TOC_ANCESTOR :
|
case Graphic3d_TOC_ANCESTOR :
|
||||||
{
|
{
|
||||||
Standard_Integer indexA = 0;
|
Standard_Integer indexA = 0;
|
||||||
Standard_Integer LengthA = MyAncestors.Length ();
|
Standard_Integer LengthA = MyAncestors.Length ();
|
||||||
@ -1552,7 +1539,7 @@ void Graphic3d_Structure::DisconnectAll (const Graphic3d_TypeOfConnection AType)
|
|||||||
Standard_Integer i, Length;
|
Standard_Integer i, Length;
|
||||||
|
|
||||||
// disconnection
|
// disconnection
|
||||||
switch (AType)
|
switch (AType)
|
||||||
{
|
{
|
||||||
case Graphic3d_TOC_DESCENDANT :
|
case Graphic3d_TOC_DESCENDANT :
|
||||||
Length = MyDescendants.Length ();
|
Length = MyDescendants.Length ();
|
||||||
@ -1567,7 +1554,7 @@ void Graphic3d_Structure::DisconnectAll (const Graphic3d_TypeOfConnection AType)
|
|||||||
case Graphic3d_TOC_ANCESTOR :
|
case Graphic3d_TOC_ANCESTOR :
|
||||||
Length = MyAncestors.Length ();
|
Length = MyAncestors.Length ();
|
||||||
for (i=1; i<=Length; i++)
|
for (i=1; i<=Length; i++)
|
||||||
// Value (1) instead of Value (i) as MyAncestors
|
// Value (1) instead of Value (i) as MyAncestors
|
||||||
// is modified by :
|
// is modified by :
|
||||||
// Graphic3d_Structure::Disconnect (AStructure)
|
// Graphic3d_Structure::Disconnect (AStructure)
|
||||||
// that takes AStructure from MyAncestors
|
// that takes AStructure from MyAncestors
|
||||||
@ -1602,7 +1589,7 @@ void Graphic3d_Structure::SetTransform (const TColStd_Array2OfReal& AMatrix, con
|
|||||||
|
|
||||||
// Assign the new transformation in an array [0..3][0..3]
|
// Assign the new transformation in an array [0..3][0..3]
|
||||||
// Avoid problemes if the user has defined matrice [1..4][1..4]
|
// Avoid problemes if the user has defined matrice [1..4][1..4]
|
||||||
// ou [3..6][-1..2] !!
|
// or [3..6][-1..2] !!
|
||||||
lr = AMatrix.LowerRow ();
|
lr = AMatrix.LowerRow ();
|
||||||
ur = AMatrix.UpperRow ();
|
ur = AMatrix.UpperRow ();
|
||||||
lc = AMatrix.LowerCol ();
|
lc = AMatrix.LowerCol ();
|
||||||
@ -1686,12 +1673,12 @@ void Graphic3d_Structure::MinMaxValues (Standard_Real& XMin, Standard_Real& YMin
|
|||||||
if ((XTMin == RF) && (YTMin == RF) &&
|
if ((XTMin == RF) && (YTMin == RF) &&
|
||||||
(ZTMin == RF) && (XTMax == RL) &&
|
(ZTMin == RF) && (XTMax == RL) &&
|
||||||
(YTMax == RL) && (ZTMax == RL)) {
|
(YTMax == RL) && (ZTMax == RL)) {
|
||||||
// Case impossible as it would mean that
|
// Case impossible as it would mean that
|
||||||
// the structure is empty
|
// the structure is empty
|
||||||
XMin = RF;
|
XMin = RF;
|
||||||
YMin = RF;
|
YMin = RF;
|
||||||
ZMin = RF;
|
ZMin = RF;
|
||||||
|
|
||||||
XMax = RL;
|
XMax = RL;
|
||||||
YMax = RL;
|
YMax = RL;
|
||||||
ZMax = RL;
|
ZMax = RL;
|
||||||
@ -1764,7 +1751,7 @@ void Graphic3d_Structure::SetTransformPersistence( const Graphic3d_TransModeFlag
|
|||||||
void Graphic3d_Structure::SetTransformPersistence( const Graphic3d_TransModeFlags& AFlag,
|
void Graphic3d_Structure::SetTransformPersistence( const Graphic3d_TransModeFlags& AFlag,
|
||||||
const gp_Pnt& APoint )
|
const gp_Pnt& APoint )
|
||||||
{
|
{
|
||||||
if (IsDeleted ()) return;
|
if (IsDeleted ()) return;
|
||||||
|
|
||||||
MyCStructure.TransformPersistence.Flag = AFlag;
|
MyCStructure.TransformPersistence.Flag = AFlag;
|
||||||
MyCStructure.TransformPersistence.Point.x = APoint.X();
|
MyCStructure.TransformPersistence.Point.x = APoint.X();
|
||||||
@ -1805,7 +1792,7 @@ void Graphic3d_Structure::Remove (const Standard_Address APtr, const Graphic3d_T
|
|||||||
|
|
||||||
Standard_Integer i, index, length;
|
Standard_Integer i, index, length;
|
||||||
|
|
||||||
switch (AType)
|
switch (AType)
|
||||||
{
|
{
|
||||||
case Graphic3d_TOC_DESCENDANT :
|
case Graphic3d_TOC_DESCENDANT :
|
||||||
index = 0;
|
index = 0;
|
||||||
@ -1924,7 +1911,7 @@ void Graphic3d_Structure::MinMaxCoord (Standard_Real& XMin, Standard_Real& YMin,
|
|||||||
YMin = YMax = (Ym+ YM)/2.0;
|
YMin = YMax = (Ym+ YM)/2.0;
|
||||||
ZMin = ZMax = (Zm+ ZM)/2.0;
|
ZMin = ZMax = (Zm+ ZM)/2.0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XMin = RF;
|
XMin = RF;
|
||||||
@ -1975,7 +1962,7 @@ void Graphic3d_Structure::MinMaxCoord (Standard_Real& XMin, Standard_Real& YMin,
|
|||||||
if ((XMin == RL) && (YMin == RL) &&
|
if ((XMin == RL) && (YMin == RL) &&
|
||||||
(ZMin == RL) && (XMax == RF) &&
|
(ZMin == RL) && (XMax == RF) &&
|
||||||
(YMax == RF) && (ZMax == RF)) {
|
(YMax == RF) && (ZMax == RF)) {
|
||||||
// Case impossible as it would mean
|
// Case impossible as it would mean
|
||||||
// that the structure is empty
|
// that the structure is empty
|
||||||
XMin = RF;
|
XMin = RF;
|
||||||
YMin = RF;
|
YMin = RF;
|
||||||
@ -2063,7 +2050,7 @@ void Graphic3d_Structure::Network (const Handle(Graphic3d_Structure)& AStructure
|
|||||||
ASet.Add (AStructure);
|
ASet.Add (AStructure);
|
||||||
|
|
||||||
// exploration
|
// exploration
|
||||||
switch (AType)
|
switch (AType)
|
||||||
{
|
{
|
||||||
|
|
||||||
case Graphic3d_TOC_DESCENDANT :
|
case Graphic3d_TOC_DESCENDANT :
|
||||||
@ -2079,15 +2066,15 @@ void Graphic3d_Structure::Network (const Handle(Graphic3d_Structure)& AStructure
|
|||||||
while (IteratorA.More ()) {
|
while (IteratorA.More ()) {
|
||||||
Graphic3d_Structure::Network
|
Graphic3d_Structure::Network
|
||||||
(IteratorA.Key (), AType, ASet);
|
(IteratorA.Key (), AType, ASet);
|
||||||
// IteratorD.Next () is located on the next structure
|
// IteratorA.Next () is located on the next structure
|
||||||
IteratorA.Next ();
|
IteratorA.Next ();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Structure::PrintNetwork (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType)
|
void Graphic3d_Structure::PrintNetwork (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType)
|
||||||
{
|
{
|
||||||
|
|
||||||
Graphic3d_MapOfStructure ASet;
|
Graphic3d_MapOfStructure ASet;
|
||||||
@ -2105,7 +2092,7 @@ void Graphic3d_Structure::PrintNetwork (const Handle(Graphic3d_Structure)& AStru
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Structure::Update () const
|
void Graphic3d_Structure::Update () const
|
||||||
{
|
{
|
||||||
|
|
||||||
if (IsDeleted ()) return;
|
if (IsDeleted ()) return;
|
||||||
@ -2115,7 +2102,7 @@ void Graphic3d_Structure::Update () const
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF)
|
void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF)
|
||||||
{
|
{
|
||||||
|
|
||||||
Standard_Real R, G, B;
|
Standard_Real R, G, B;
|
||||||
@ -2134,7 +2121,7 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)&
|
|||||||
Aspect_InteriorStyle AStyle;
|
Aspect_InteriorStyle AStyle;
|
||||||
Aspect_TypeOfStyleText AStyleT;
|
Aspect_TypeOfStyleText AStyleT;
|
||||||
Aspect_TypeOfDisplayText ADisplayType;
|
Aspect_TypeOfDisplayText ADisplayType;
|
||||||
Quantity_Color AColorSubTitle;
|
Quantity_Color AColorSubTitle;
|
||||||
Standard_Boolean ATextZoomable;
|
Standard_Boolean ATextZoomable;
|
||||||
Standard_Real ATextAngle;
|
Standard_Real ATextAngle;
|
||||||
OSD_FontAspect ATextFontAspect;
|
OSD_FontAspect ATextFontAspect;
|
||||||
@ -2175,7 +2162,7 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)&
|
|||||||
MyCStructure.ContextText.ColorSubTitle.b = float (Bs);
|
MyCStructure.ContextText.ColorSubTitle.b = float (Bs);
|
||||||
MyCStructure.ContextText.TextZoomable = ATextZoomable;
|
MyCStructure.ContextText.TextZoomable = ATextZoomable;
|
||||||
MyCStructure.ContextText.TextAngle = ATextAngle;
|
MyCStructure.ContextText.TextAngle = ATextAngle;
|
||||||
MyCStructure.ContextText.TextFontAspect = (int)ATextFontAspect;
|
MyCStructure.ContextText.TextFontAspect = (int)ATextFontAspect;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2205,7 +2192,7 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)&
|
|||||||
MyCStructure.ContextFillArea.Hatch = int (CTXF->HatchStyle ());
|
MyCStructure.ContextFillArea.Hatch = int (CTXF->HatchStyle ());
|
||||||
#ifdef G003
|
#ifdef G003
|
||||||
Quantity_Ratio ratio;
|
Quantity_Ratio ratio;
|
||||||
MyCStructure.ContextFillArea.DegenerationMode =
|
MyCStructure.ContextFillArea.DegenerationMode =
|
||||||
int (CTXF->DegenerateModel(ratio));
|
int (CTXF->DegenerateModel(ratio));
|
||||||
MyCStructure.ContextFillArea.SkipRatio = float (ratio);
|
MyCStructure.ContextFillArea.SkipRatio = float (ratio);
|
||||||
#endif // G003
|
#endif // G003
|
||||||
@ -2277,7 +2264,7 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)&
|
|||||||
MyCStructure.ContextFillArea.Back.ColorEms.b =
|
MyCStructure.ContextFillArea.Back.ColorEms.b =
|
||||||
float (((CTXF->BackMaterial ()).EmissiveColor ()).Blue ());
|
float (((CTXF->BackMaterial ()).EmissiveColor ()).Blue ());
|
||||||
|
|
||||||
MyCStructure.ContextFillArea.Back.EnvReflexion =
|
MyCStructure.ContextFillArea.Back.EnvReflexion =
|
||||||
float ((CTXF->BackMaterial ()).EnvReflexion());
|
float ((CTXF->BackMaterial ()).EnvReflexion());
|
||||||
|
|
||||||
/*** Front Material ***/
|
/*** Front Material ***/
|
||||||
@ -2343,7 +2330,7 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)&
|
|||||||
MyCStructure.ContextFillArea.Front.ColorEms.b =
|
MyCStructure.ContextFillArea.Front.ColorEms.b =
|
||||||
float (((CTXF->FrontMaterial ()).EmissiveColor ()).Blue ());
|
float (((CTXF->FrontMaterial ()).EmissiveColor ()).Blue ());
|
||||||
|
|
||||||
MyCStructure.ContextFillArea.Front.EnvReflexion =
|
MyCStructure.ContextFillArea.Front.EnvReflexion =
|
||||||
float ((CTXF->FrontMaterial ()).EnvReflexion());
|
float ((CTXF->FrontMaterial ()).EnvReflexion());
|
||||||
|
|
||||||
Handle(Graphic3d_TextureMap) TempTextureMap = CTXF->TextureMap();
|
Handle(Graphic3d_TextureMap) TempTextureMap = CTXF->TextureMap();
|
||||||
@ -2354,14 +2341,14 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)&
|
|||||||
|
|
||||||
MyCStructure.ContextFillArea.Texture.doTextureMap = CTXF->TextureMapState() ? 1:0;
|
MyCStructure.ContextFillArea.Texture.doTextureMap = CTXF->TextureMapState() ? 1:0;
|
||||||
|
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
Standard_Integer aPolyMode;
|
Standard_Integer aPolyMode;
|
||||||
Standard_Real aPolyFactor, aPolyUnits;
|
Standard_Real aPolyFactor, aPolyUnits;
|
||||||
CTXF->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits);
|
CTXF->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits);
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetMode = aPolyMode;
|
MyCStructure.ContextFillArea.PolygonOffsetMode = aPolyMode;
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetFactor = aPolyFactor;
|
MyCStructure.ContextFillArea.PolygonOffsetFactor = aPolyFactor;
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetUnits = aPolyUnits;
|
MyCStructure.ContextFillArea.PolygonOffsetUnits = aPolyUnits;
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Structure::GraphicHighlight (const Aspect_TypeOfHighlightMethod AMethod) {
|
void Graphic3d_Structure::GraphicHighlight (const Aspect_TypeOfHighlightMethod AMethod) {
|
||||||
@ -2372,7 +2359,7 @@ void Graphic3d_Structure::GraphicHighlight (const Aspect_TypeOfHighlightMethod A
|
|||||||
MyCStructure.highlight = 1;
|
MyCStructure.highlight = 1;
|
||||||
MyHighlightMethod = AMethod;
|
MyHighlightMethod = AMethod;
|
||||||
|
|
||||||
switch (AMethod)
|
switch (AMethod)
|
||||||
{
|
{
|
||||||
case Aspect_TOHM_COLOR :
|
case Aspect_TOHM_COLOR :
|
||||||
MyHighlightColor.Values (R, G, B, Quantity_TOC_RGB);
|
MyHighlightColor.Values (R, G, B, Quantity_TOC_RGB);
|
||||||
@ -2427,7 +2414,7 @@ void Graphic3d_Structure::GraphicUnHighlight () {
|
|||||||
|
|
||||||
MyCStructure.highlight = 0;
|
MyCStructure.highlight = 0;
|
||||||
|
|
||||||
switch (MyHighlightMethod)
|
switch (MyHighlightMethod)
|
||||||
{
|
{
|
||||||
case Aspect_TOHM_COLOR :
|
case Aspect_TOHM_COLOR :
|
||||||
MyGraphicDriver->HighlightColor
|
MyGraphicDriver->HighlightColor
|
||||||
|
@ -56,6 +56,8 @@ void PrsMgr_Presentation3d::Clear() {
|
|||||||
// Consequence:
|
// Consequence:
|
||||||
// 1. The memory zone of the group is reused
|
// 1. The memory zone of the group is reused
|
||||||
// 2. The speed for animation is constant
|
// 2. The speed for animation is constant
|
||||||
|
//myPresentableObject = NULL;
|
||||||
|
SetUpdateStatus(Standard_True);
|
||||||
myStructure->Clear(Standard_True);
|
myStructure->Clear(Standard_True);
|
||||||
// myStructure->Clear(Standard_False);
|
// myStructure->Clear(Standard_False);
|
||||||
|
|
||||||
|
@ -1624,7 +1624,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckNotchedEdges(const Standard_Integer nu
|
|||||||
ShapeAnalysis_Curve sac;
|
ShapeAnalysis_Curve sac;
|
||||||
|
|
||||||
gp_Pnt Proj1, Proj2;
|
gp_Pnt Proj1, Proj2;
|
||||||
Standard_Real param1, param2;
|
Standard_Real param1 = 0., param2 = 0.;
|
||||||
p2d2=c2d2->Value(E2.Orientation()==TopAbs_FORWARD ? b2 : a2);
|
p2d2=c2d2->Value(E2.Orientation()==TopAbs_FORWARD ? b2 : a2);
|
||||||
p2d1=c2d1->Value(E1.Orientation()==TopAbs_FORWARD ? a1 : b1);
|
p2d1=c2d1->Value(E1.Orientation()==TopAbs_FORWARD ? a1 : b1);
|
||||||
Standard_Real dist1 = ProjectInside(Ad1,gp_Pnt(p2d2.X(),p2d2.Y(),0),Tolerance,Proj1,param1,Standard_False);
|
Standard_Real dist1 = ProjectInside(Ad1,gp_Pnt(p2d2.X(),p2d2.Y(),0),Tolerance,Proj1,param1,Standard_False);
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user