mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0026290: It is neccessary to separate visualization part from TKCAF
- Package TPrsStd is moved into new toolkit TKVCAF. This is the only toolkit in OCAF that depends on visualization libraries. - All persistent data stored in TPrsStd_AISPresentation attribute are moved to new attribute TDataXtd_Presentation, which is maintained automatically on the same label as TPrsStd_AISPresentation. All parameters used by TPrsStd_AISPresentation are stored in corresponding TDataXtd_Presentation attribute. - TPrsStd_AISPresentation is not stored in file any more; when OCAF document is loaded from a file, these attributes are created at all labels where TDataXtd_Presentation attribute is located, by TPrsStd_AISViewer::New(). - File src/StdResources/MigrationSheet.txt necessary for reading files written by previous versions of OCCT (lost in one of previous integrations) is restored and updated as necessary to handle this change (defines replacement of TPrsStd_AISPresentation by TDataXtd_Presentation). Environment variable CSF_MIGRATION_TYPES should be defined, pointing to this file. - Packages BinMPrsStd and XmlMPrsStd are removed; their drivers are moved into BinMDataXtd and XmlMDataXtd respectively. - Version numbers of BinOCAF and XmlOCAF formats are increased, new files cannot be read by previous versions of OCCT - New tests added - Adding new TKVCAF toolkit in sample projects - Restore IsDisplayed(false) in TPrsStd_AISPresentation::Erase()
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
00000000-0000-0000-0000-000000000000 Reserved
|
||||
ffffffff-ffff-ffff-ffff-ffffffffffff Reserved
|
||||
|
||||
04fb4d00-5690-11d1-8940-080009dc3333 TPrsStd_AISPresentation
|
||||
3680ac6c-47ae-4366-bb94-26abb6e07341 TPrsStd_AISPresentation
|
||||
04fb4d01-5690-11d1-8940-080009dc3333 TPrsStd_ColorAttribute
|
||||
04fb4d02-5690-11d1-8940-080009dc3333 TPrsStd_TransparencyAttribute
|
||||
04fb4d04-5690-11d1-8940-080009dc3333 TPrsStd_GraphicAttribute
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -27,6 +27,9 @@
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDataXtd_Presentation.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
|
||||
class AIS_InteractiveObject;
|
||||
class Standard_GUID;
|
||||
class TDF_Label;
|
||||
@@ -34,7 +37,6 @@ class TDF_Attribute;
|
||||
class TDF_RelocationTable;
|
||||
class TDF_AttributeDelta;
|
||||
|
||||
|
||||
class TPrsStd_AISPresentation;
|
||||
DEFINE_STANDARD_HANDLE(TPrsStd_AISPresentation, TDF_Attribute)
|
||||
|
||||
@@ -185,18 +187,14 @@ public:
|
||||
//! update AIS viewer according to delta
|
||||
Standard_EXPORT virtual Standard_Boolean AfterUndo (const Handle(TDF_AttributeDelta)& anAttDelta, const Standard_Boolean forceIt = Standard_False) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(TPrsStd_AISPresentation,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//! Returns attribute storing presentation data
|
||||
Handle(TDataXtd_Presentation) getData () const;
|
||||
|
||||
Handle(AIS_InteractiveContext) getAISContext() const;
|
||||
|
||||
//! Updates AIS_InteractiveObject stored in the attribute
|
||||
//! and applies the visualization settings
|
||||
@@ -210,29 +208,9 @@ private:
|
||||
//! from AIS_InteractiveContext instead of simple erasing in the viewer
|
||||
Standard_EXPORT void AISErase (const Standard_Boolean remove = Standard_False);
|
||||
|
||||
Standard_GUID myDriverGUID;
|
||||
Standard_Real myTransparency;
|
||||
Quantity_NameOfColor myColor;
|
||||
Graphic3d_NameOfMaterial myMaterial;
|
||||
Standard_Real myWidth;
|
||||
Standard_Integer myMode;
|
||||
Standard_Integer mySelectionMode;
|
||||
Standard_Boolean isDisplayed;
|
||||
Standard_Boolean hasOwnColor;
|
||||
Standard_Boolean hasOwnMaterial;
|
||||
Standard_Boolean hasOwnTransparency;
|
||||
Standard_Boolean hasOwnWidth;
|
||||
Standard_Boolean hasOwnMode;
|
||||
Standard_Boolean hasOwnSelectionMode;
|
||||
private:
|
||||
Handle(AIS_InteractiveObject) myAIS;
|
||||
|
||||
|
||||
Handle(TDataXtd_Presentation) myData;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TPrsStd_AISPresentation_HeaderFile
|
||||
|
@@ -19,8 +19,11 @@
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TDataXtd_Presentation.hxx>
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <TPrsStd_AISViewer.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
|
||||
@@ -50,6 +53,17 @@ Handle(TPrsStd_AISViewer) TPrsStd_AISViewer::New (const TDF_Label& acces,
|
||||
V = new TPrsStd_AISViewer();
|
||||
V->SetInteractiveContext (new AIS_InteractiveContext(viewer));
|
||||
acces.Root().AddAttribute(V);
|
||||
|
||||
// put TPrsStd_AISPresentation attribute at all labels containing
|
||||
// TDataXtd_Presentation attribute
|
||||
for (TDF_ChildIterator anIt(acces.Root(), Standard_True); anIt.More(); anIt.Next())
|
||||
{
|
||||
Handle(TDataXtd_Presentation) aPrsData;
|
||||
if (anIt.Value().FindAttribute(TDataXtd_Presentation::GetID(), aPrsData)) {
|
||||
TPrsStd_AISPresentation::Set (anIt.Value(), aPrsData->GetDriverGUID());
|
||||
}
|
||||
}
|
||||
|
||||
return V;
|
||||
}
|
||||
|
||||
@@ -67,6 +81,17 @@ Handle(TPrsStd_AISViewer) TPrsStd_AISViewer::New (const TDF_Label& acces,
|
||||
V = new TPrsStd_AISViewer();
|
||||
V->SetInteractiveContext (IC);
|
||||
acces.Root().AddAttribute(V);
|
||||
|
||||
// put TPrsStd_AISPresentation attribute at all labels containing
|
||||
// TDataXtd_Presentation attribute
|
||||
for (TDF_ChildIterator anIt(acces.Root(), Standard_True); anIt.More(); anIt.Next())
|
||||
{
|
||||
Handle(TDataXtd_Presentation) aPrsData;
|
||||
if (anIt.Value().FindAttribute(TDataXtd_Presentation::GetID(), aPrsData)) {
|
||||
TPrsStd_AISPresentation::Set (anIt.Value(), aPrsData->GetDriverGUID());
|
||||
}
|
||||
}
|
||||
|
||||
return V;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user