mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0025180: Visualization - Homogeneous transformation API in TKV3d
PrsMgr_PresentableObject, Graphic3d_Structure now consistently take and store Handle(Geom_Transformation) instead of TColStd_Array2OfReal / Graphic3d_Mat4. Low-level advanced methods have been modified to pass Handle(Geom_Transformation). High-level methods have been preserved accepting old syntax taking gp_Trsf. Geom_Transformation now inlines most methods.
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
#ifndef _PrsMgr_ListOfPresentableObjects_HeaderFile
|
||||
#define _PrsMgr_ListOfPresentableObjects_HeaderFile
|
||||
|
||||
#include <PrsMgr_PresentableObject.hxx>
|
||||
#include <NCollection_List.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
class PrsMgr_PresentableObject; // use forward declaration since PrsMgr_PresentableObject.hxx uses PrsMgr_ListOfPresentableObjects
|
||||
typedef NCollection_List<Handle(PrsMgr_PresentableObject)> PrsMgr_ListOfPresentableObjects;
|
||||
typedef NCollection_List<Handle(PrsMgr_PresentableObject)>::Iterator PrsMgr_ListOfPresentableObjectsIter;
|
||||
|
||||
|
||||
#endif // _PrsMgr_ListOfPresentableObjects_HeaderFile
|
||||
|
@@ -16,24 +16,29 @@
|
||||
|
||||
#include <PrsMgr_PresentableObject.hxx>
|
||||
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <Graphic3d_DataStructureManager.hxx>
|
||||
#include <Graphic3d_Structure.hxx>
|
||||
#include <Graphic3d_TypeOfStructure.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Projector.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <PrsMgr_Presentation.hxx>
|
||||
#include <PrsMgr_PresentationManager.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_PresentableObject,MMgt_TShared)
|
||||
|
||||
namespace
|
||||
{
|
||||
static const gp_Trsf THE_IDENTITY_TRSF;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : getIdentityTrsf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const gp_Trsf& PrsMgr_PresentableObject::getIdentityTrsf()
|
||||
{
|
||||
return THE_IDENTITY_TRSF;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PrsMgr_PresentableObject
|
||||
//purpose :
|
||||
@@ -54,10 +59,9 @@ PrsMgr_PresentableObject::PrsMgr_PresentableObject (const PrsMgr_TypeOfPresentat
|
||||
//=======================================================================
|
||||
PrsMgr_PresentableObject::~PrsMgr_PresentableObject()
|
||||
{
|
||||
gp_Trsf anIdentity;
|
||||
for (PrsMgr_ListOfPresentableObjectsIter anIter (myChildren); anIter.More(); anIter.Next())
|
||||
{
|
||||
anIter.Value()->SetCombinedParentTransform (anIdentity);
|
||||
anIter.Value()->SetCombinedParentTransform (Handle(Geom_Transformation)());
|
||||
anIter.Value()->myParent = NULL;
|
||||
}
|
||||
}
|
||||
@@ -164,23 +168,6 @@ void PrsMgr_PresentableObject::Update (const Standard_Integer aMode, const Stand
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Presentations
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
PrsMgr_Presentations& PrsMgr_PresentableObject::Presentations() {
|
||||
return myPresentations;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HasTransformation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean PrsMgr_PresentableObject::HasTransformation() const
|
||||
{
|
||||
return myTransformation.Form() != gp_Identity;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetToUpdate
|
||||
//purpose :
|
||||
@@ -241,10 +228,10 @@ void PrsMgr_PresentableObject::SetTypeOfPresentation (const PrsMgr_TypeOfPresent
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetLocalTransformation
|
||||
//purpose : WARNING : use with only 3D objects...
|
||||
//function : setLocalTransformation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PrsMgr_PresentableObject::SetLocalTransformation (const gp_Trsf& theTransformation)
|
||||
void PrsMgr_PresentableObject::setLocalTransformation (const Handle(Geom_Transformation)& theTransformation)
|
||||
{
|
||||
myLocalTransformation = theTransformation;
|
||||
UpdateTransformation();
|
||||
@@ -256,16 +243,16 @@ void PrsMgr_PresentableObject::SetLocalTransformation (const gp_Trsf& theTransfo
|
||||
//=======================================================================
|
||||
void PrsMgr_PresentableObject::ResetTransformation()
|
||||
{
|
||||
SetLocalTransformation (gp_Trsf());
|
||||
setLocalTransformation (Handle(Geom_Transformation)());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetCombinedParentTransform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PrsMgr_PresentableObject::SetCombinedParentTransform (const gp_Trsf& theTransformation)
|
||||
void PrsMgr_PresentableObject::SetCombinedParentTransform (const Handle(Geom_Transformation)& theTrsf)
|
||||
{
|
||||
myCombinedParentTransform = theTransformation;
|
||||
myCombinedParentTransform = theTrsf;
|
||||
UpdateTransformation();
|
||||
}
|
||||
|
||||
@@ -275,20 +262,36 @@ void PrsMgr_PresentableObject::SetCombinedParentTransform (const gp_Trsf& theTra
|
||||
//=======================================================================
|
||||
void PrsMgr_PresentableObject::UpdateTransformation()
|
||||
{
|
||||
myTransformation = myCombinedParentTransform * myLocalTransformation;
|
||||
myInvTransformation = myTransformation.Inverted();
|
||||
Handle(Geom_Transformation) aTrsf = new Geom_Transformation (myTransformation);
|
||||
myTransformation.Nullify();
|
||||
myInvTransformation = gp_Trsf();
|
||||
if (!myCombinedParentTransform.IsNull() && myCombinedParentTransform->Form() != gp_Identity)
|
||||
{
|
||||
if (!myLocalTransformation.IsNull() && myLocalTransformation->Form() != gp_Identity)
|
||||
{
|
||||
const gp_Trsf aTrsf = myCombinedParentTransform->Trsf() * myLocalTransformation->Trsf();
|
||||
myTransformation = new Geom_Transformation (aTrsf);
|
||||
myInvTransformation = aTrsf.Inverted();
|
||||
}
|
||||
else
|
||||
{
|
||||
myTransformation = myCombinedParentTransform;
|
||||
myInvTransformation = myCombinedParentTransform->Trsf().Inverted();
|
||||
}
|
||||
}
|
||||
else if (!myLocalTransformation.IsNull() && myLocalTransformation->Form() != gp_Identity)
|
||||
{
|
||||
myTransformation = myLocalTransformation;
|
||||
myInvTransformation = myLocalTransformation->Trsf().Inverted();
|
||||
}
|
||||
|
||||
for (Standard_Integer aPrsIter = 1; aPrsIter <= myPresentations.Length(); ++aPrsIter)
|
||||
{
|
||||
myPresentations (aPrsIter).Presentation()->Transform (aTrsf);
|
||||
myPresentations (aPrsIter).Presentation()->SetTransformation (myTransformation);
|
||||
}
|
||||
|
||||
PrsMgr_ListOfPresentableObjectsIter anIter (myChildren);
|
||||
|
||||
for (; anIter.More(); anIter.Next())
|
||||
for (PrsMgr_ListOfPresentableObjectsIter aChildIter (myChildren); aChildIter.More(); aChildIter.Next())
|
||||
{
|
||||
anIter.Value()->SetCombinedParentTransform (myTransformation);
|
||||
aChildIter.Value()->SetCombinedParentTransform (myTransformation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,8 +301,7 @@ void PrsMgr_PresentableObject::UpdateTransformation()
|
||||
//=======================================================================
|
||||
void PrsMgr_PresentableObject::UpdateTransformation(const Handle(Prs3d_Presentation)& P)
|
||||
{
|
||||
Handle(Geom_Transformation) aTrsf = new Geom_Transformation (myTransformation);
|
||||
P->Transform (aTrsf);
|
||||
P->SetTransformation (myTransformation);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -392,7 +394,7 @@ void PrsMgr_PresentableObject::RemoveChild (const Handle(PrsMgr_PresentableObjec
|
||||
if (anIter.Value() == theObject)
|
||||
{
|
||||
theObject->myParent = NULL;
|
||||
theObject->SetCombinedParentTransform (gp_Trsf());
|
||||
theObject->SetCombinedParentTransform (Handle(Geom_Transformation)());
|
||||
myChildren.Remove (anIter);
|
||||
break;
|
||||
}
|
||||
|
@@ -17,40 +17,19 @@
|
||||
#ifndef _PrsMgr_PresentableObject_HeaderFile
|
||||
#define _PrsMgr_PresentableObject_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <PrsMgr_Presentations.hxx>
|
||||
#include <PrsMgr_TypeOfPresentation3d.hxx>
|
||||
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
#include <PrsMgr_PresentableObjectPointer.hxx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <PrsMgr_ListOfPresentableObjects.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <PrsMgr_Presentation.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Graphic3d_ClipPlane.hxx>
|
||||
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||
#include <Graphic3d_TransformPers.hxx>
|
||||
#include <Graphic3d_TransModeFlags.hxx>
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
#include <PrsMgr_ListOfPresentableObjects.hxx>
|
||||
#include <PrsMgr_Presentation.hxx>
|
||||
#include <PrsMgr_Presentations.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <PrsMgr_PresentableObjectPointer.hxx>
|
||||
#include <PrsMgr_TypeOfPresentation3d.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
#include <Graphic3d_ClipPlane.hxx>
|
||||
class Standard_NotImplemented;
|
||||
class PrsMgr_Presentation;
|
||||
class PrsMgr_PresentationManager;
|
||||
class Graphic3d_Structure;
|
||||
class Graphic3d_DataStructureManager;
|
||||
class Geom_Transformation;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class gp_Pnt;
|
||||
class gp_Trsf;
|
||||
|
||||
|
||||
class PrsMgr_PresentableObject;
|
||||
DEFINE_STANDARD_HANDLE(PrsMgr_PresentableObject, MMgt_TShared)
|
||||
|
||||
//! A framework to supply the Graphic3d
|
||||
//! structure of the object to be presented. On the first
|
||||
@@ -69,11 +48,10 @@ DEFINE_STANDARD_HANDLE(PrsMgr_PresentableObject, MMgt_TShared)
|
||||
//! creation of new interactive objects.
|
||||
class PrsMgr_PresentableObject : public MMgt_TShared
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(PrsMgr_PresentableObject, MMgt_TShared)
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT PrsMgr_Presentations& Presentations();
|
||||
PrsMgr_Presentations& Presentations() { return myPresentations; }
|
||||
|
||||
//! Returns information on whether the object accepts display in HLR mode or not.
|
||||
PrsMgr_TypeOfPresentation3d TypeOfPresentation3d() const { return myTypeOfPresentation3d; }
|
||||
@@ -132,15 +110,30 @@ public:
|
||||
//! gives the list of modes which are flagged "to be updated".
|
||||
Standard_EXPORT void ToBeUpdated (TColStd_ListOfInteger& ListOfMode) const;
|
||||
|
||||
//! Return the local transformation.
|
||||
const Handle(Geom_Transformation)& LocalTransformationGeom() const { return myLocalTransformation; }
|
||||
|
||||
//! Sets local transformation to theTransformation.
|
||||
Standard_EXPORT virtual void SetLocalTransformation (const gp_Trsf& theTransformation);
|
||||
|
||||
void SetLocalTransformation (const gp_Trsf& theTrsf) { setLocalTransformation (new Geom_Transformation (theTrsf)); }
|
||||
|
||||
//! Sets local transformation to theTransformation.
|
||||
void SetLocalTransformation (const Handle(Geom_Transformation)& theTrsf) { setLocalTransformation (theTrsf); }
|
||||
|
||||
//! Returns true if object has a transformation that is different from the identity.
|
||||
Standard_EXPORT Standard_Boolean HasTransformation() const;
|
||||
Standard_Boolean HasTransformation() const { return !myTransformation.IsNull() && myTransformation->Form() != gp_Identity; }
|
||||
|
||||
const gp_Trsf& LocalTransformation() const { return myLocalTransformation; }
|
||||
//! Return the transformation taking into account transformation of parent object(s).
|
||||
const Handle(Geom_Transformation)& TransformationGeom() const { return myTransformation; }
|
||||
|
||||
const gp_Trsf& Transformation() const { return myTransformation; }
|
||||
//! Return the local transformation.
|
||||
const gp_Trsf& LocalTransformation() const { return !myLocalTransformation.IsNull()
|
||||
? myLocalTransformation->Trsf()
|
||||
: getIdentityTrsf(); }
|
||||
|
||||
//! Return the transformation taking into account transformation of parent object(s).
|
||||
const gp_Trsf& Transformation() const { return !myTransformation.IsNull()
|
||||
? myTransformation->Trsf()
|
||||
: getIdentityTrsf(); }
|
||||
|
||||
const gp_GTrsf& InversedTransformation() const { return myInvTransformation; }
|
||||
|
||||
@@ -227,9 +220,6 @@ friend
|
||||
friend
|
||||
Standard_EXPORT void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, const Handle(Geom_Transformation)& theTrsf, const Handle(Graphic3d_Structure)& theGivenStruct);
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(PrsMgr_PresentableObject,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -282,13 +272,21 @@ Standard_EXPORT virtual ~PrsMgr_PresentableObject();
|
||||
|
||||
//! Sets myCombinedParentTransform to theTransformation. Thus object receives transformation
|
||||
//! from parent node and able to derive its own.
|
||||
Standard_EXPORT virtual void SetCombinedParentTransform (const gp_Trsf& theTransformation);
|
||||
Standard_EXPORT virtual void SetCombinedParentTransform (const Handle(Geom_Transformation)& theTrsf);
|
||||
|
||||
//! General virtual method for internal update of presentation state
|
||||
//! when some modifications on list of clip planes occurs. Base
|
||||
//! implementation propagate clip planes to every presentation.
|
||||
Standard_EXPORT virtual void UpdateClipping();
|
||||
|
||||
//! Sets local transformation to theTransformation.
|
||||
Standard_EXPORT virtual void setLocalTransformation (const Handle(Geom_Transformation)& theTransformation);
|
||||
|
||||
private:
|
||||
|
||||
//! Return the identity transformation.
|
||||
Standard_EXPORT static const gp_Trsf& getIdentityTrsf();
|
||||
|
||||
protected:
|
||||
|
||||
PrsMgr_Presentations myPresentations;
|
||||
@@ -302,12 +300,14 @@ private:
|
||||
|
||||
Handle(Graphic3d_TransformPers) myTransformPersistence;
|
||||
PrsMgr_PresentableObjectPointer myParent;
|
||||
gp_Trsf myLocalTransformation;
|
||||
gp_Trsf myTransformation;
|
||||
Handle(Geom_Transformation) myLocalTransformation;
|
||||
Handle(Geom_Transformation) myTransformation;
|
||||
Handle(Geom_Transformation) myCombinedParentTransform;
|
||||
gp_GTrsf myInvTransformation;
|
||||
gp_Trsf myCombinedParentTransform;
|
||||
PrsMgr_ListOfPresentableObjects myChildren;
|
||||
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(PrsMgr_PresentableObject, MMgt_TShared)
|
||||
|
||||
#endif // _PrsMgr_PresentableObject_HeaderFile
|
||||
|
@@ -226,43 +226,12 @@ void PrsMgr_Presentation::Connect (const Handle(PrsMgr_Presentation)& theOther)
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Transform
|
||||
//function : SetTransformation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PrsMgr_Presentation::Transform (const Handle(Geom_Transformation)& theTrsf) const
|
||||
void PrsMgr_Presentation::SetTransformation (const Handle(Geom_Transformation)& theTrsf) const
|
||||
{
|
||||
myStructure->Transform (theTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Place
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PrsMgr_Presentation::Place (const Quantity_Length theX,
|
||||
const Quantity_Length theY,
|
||||
const Quantity_Length theZ) const
|
||||
{
|
||||
myStructure->Place (theX, theY, theZ);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Multiply
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PrsMgr_Presentation::Multiply (const Handle(Geom_Transformation)& theTrsf) const
|
||||
{
|
||||
myStructure->Multiply (theTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Move
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PrsMgr_Presentation::Move (const Quantity_Length theX,
|
||||
const Quantity_Length theY,
|
||||
const Quantity_Length theZ) const
|
||||
{
|
||||
myStructure->Move (theX, theY, theZ);
|
||||
myStructure->SetTransformation (theTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -321,7 +290,7 @@ Handle(Graphic3d_Structure) PrsMgr_Presentation::Compute (const Handle(Graphic3d
|
||||
if (theTrsf->Form() == gp_Translation)
|
||||
{
|
||||
myPresentableObject->Compute (Projector (theProjector), aPrs3d);
|
||||
aPrs3d->Transform (theTrsf);
|
||||
aPrs3d->SetTransformation (theTrsf);
|
||||
return aPrs3d;
|
||||
}
|
||||
|
||||
@@ -342,7 +311,7 @@ Handle(Graphic3d_Structure) PrsMgr_Presentation::Compute (const Handle(Graphic3d
|
||||
}
|
||||
|
||||
myPresentableObject->Compute (Projector (theProjector), aPrs3d);
|
||||
aPrs3d->Transform (theTrsf);
|
||||
aPrs3d->SetTransformation (theTrsf);
|
||||
return aPrs3d;
|
||||
}
|
||||
|
||||
|
@@ -109,13 +109,7 @@ private:
|
||||
|
||||
Standard_EXPORT void Connect (const Handle(PrsMgr_Presentation)& theOther) const;
|
||||
|
||||
Standard_EXPORT void Transform (const Handle(Geom_Transformation)& theTrsf) const;
|
||||
|
||||
Standard_EXPORT void Place (const Quantity_Length theX, const Quantity_Length theY, const Quantity_Length theZ) const;
|
||||
|
||||
Standard_EXPORT void Multiply (const Handle(Geom_Transformation)& theTrsf) const;
|
||||
|
||||
Standard_EXPORT void Move (const Quantity_Length theX, const Quantity_Length theY, const Quantity_Length theZ) const;
|
||||
Standard_EXPORT void SetTransformation (const Handle(Geom_Transformation)& theTrsf) const;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Graphic3d_Structure)& theStructure);
|
||||
|
||||
|
@@ -593,7 +593,7 @@ void PrsMgr_PresentationManager::Transform (const Handle(PrsMgr_PresentableObjec
|
||||
const Handle(Geom_Transformation)& theTransformation,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
Presentation (thePrsObj, theMode)->Transform (theTransformation);
|
||||
Presentation (thePrsObj, theMode)->SetTransformation (theTransformation);
|
||||
}
|
||||
|
||||
|
||||
@@ -656,13 +656,13 @@ namespace
|
||||
{
|
||||
// =======================================================================
|
||||
// function : updatePrsTransformation
|
||||
// purpose : Internal funtion that scans thePrsList for shadow presentations
|
||||
// purpose : Internal function that scans thePrsList for shadow presentations
|
||||
// and applies transformation theTrsf to them in case if parent ID
|
||||
// of shadow presentation is equal to theRefId
|
||||
// =======================================================================
|
||||
void updatePrsTransformation (const PrsMgr_ListOfPresentations& thePrsList,
|
||||
const Standard_Integer theRefId,
|
||||
const Graphic3d_Mat4& theTrsf)
|
||||
const Handle(Geom_Transformation)& theTrsf)
|
||||
{
|
||||
for (PrsMgr_ListOfPresentations::Iterator anIter (thePrsList); anIter.More(); anIter.Next())
|
||||
{
|
||||
@@ -674,7 +674,7 @@ namespace
|
||||
if (aShadowPrs.IsNull() || aShadowPrs->ParentId() != theRefId)
|
||||
continue;
|
||||
|
||||
aShadowPrs->CStructure()->Transformation = theTrsf;
|
||||
aShadowPrs->CStructure()->SetTransformation (theTrsf);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -696,7 +696,7 @@ void PrsMgr_PresentationManager::UpdateHighlightTrsf (const Handle(V3d_Viewer)&
|
||||
aBasePrs : Presentation (theSelObj, theMode, Standard_False)->Presentation();
|
||||
const Standard_Integer aParentId = aParentPrs->CStructure()->Id;
|
||||
|
||||
updatePrsTransformation (myImmediateList, aParentId, aBasePrs->CStructure()->Transformation);
|
||||
updatePrsTransformation (myImmediateList, aParentId, aBasePrs->CStructure()->Transformation());
|
||||
|
||||
if (!myViewDependentImmediateList.IsEmpty())
|
||||
{
|
||||
@@ -708,7 +708,7 @@ void PrsMgr_PresentationManager::UpdateHighlightTrsf (const Handle(V3d_Viewer)&
|
||||
{
|
||||
updatePrsTransformation (myViewDependentImmediateList,
|
||||
aViewDepParentPrs->CStructure()->Id,
|
||||
aBasePrs->CStructure()->Transformation);
|
||||
aBasePrs->CStructure()->Transformation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <PrsMgr_Prs.hxx>
|
||||
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
@@ -20,7 +21,6 @@
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <PrsMgr_Presentation.hxx>
|
||||
#include <PrsMgr_Prs.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_Prs,Prs3d_Presentation)
|
||||
@@ -55,20 +55,13 @@ Handle(Graphic3d_Structure) PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStruc
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Compute
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Graphic3d_Structure) PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector,
|
||||
const TColStd_Array2OfReal& AMatrix)
|
||||
Handle(Graphic3d_Structure) PrsMgr_Prs::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
|
||||
const Handle(Geom_Transformation)& theTrsf)
|
||||
{
|
||||
gp_Trsf TheTrsf;
|
||||
Standard_Integer LC(AMatrix.LowerCol()),LR(AMatrix.LowerRow());
|
||||
TheTrsf.SetValues(AMatrix(LR,LC),AMatrix(LR,LC+1),AMatrix(LR,LC+2),AMatrix(LR,LC+3),
|
||||
AMatrix(LR+1,LC),AMatrix(LR+1,LC+1),AMatrix(LR+1,LC+2),AMatrix(LR+1,LC+3),
|
||||
AMatrix(LR+2,LC),AMatrix(LR+2,LC+1),AMatrix(LR+2,LC+2),AMatrix(LR+2,LC+3));
|
||||
Handle(Geom_Transformation) G = new Geom_Transformation(TheTrsf);
|
||||
|
||||
return myPresentation3d->Compute(aProjector,G);
|
||||
return myPresentation3d->Compute (theProjector, theTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -85,20 +78,12 @@ void PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjecto
|
||||
|
||||
//=======================================================================
|
||||
//function : Compute
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector,
|
||||
const TColStd_Array2OfReal& AMatrix,
|
||||
Handle(Graphic3d_Structure)& aGivenStruct)
|
||||
void PrsMgr_Prs::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
|
||||
const Handle(Geom_Transformation)& theTrsf,
|
||||
Handle(Graphic3d_Structure)& theGivenStruct)
|
||||
{
|
||||
gp_Trsf TheTrsf;
|
||||
Standard_Integer LC(AMatrix.LowerCol()),LR(AMatrix.LowerRow());
|
||||
TheTrsf.SetValues(AMatrix(LR,LC),AMatrix(LR,LC+1),AMatrix(LR,LC+2),AMatrix(LR,LC+3),
|
||||
AMatrix(LR+1,LC),AMatrix(LR+1,LC+1),AMatrix(LR+1,LC+2),AMatrix(LR+1,LC+3),
|
||||
AMatrix(LR+2,LC),AMatrix(LR+2,LC+1),AMatrix(LR+2,LC+2),AMatrix(LR+2,LC+3));
|
||||
Handle(Geom_Transformation) G = new Geom_Transformation(TheTrsf);
|
||||
|
||||
|
||||
myPresentation3d->Compute(aProjector,G,aGivenStruct);
|
||||
myPresentation3d->Compute (theProjector, theTrsf, theGivenStruct);
|
||||
}
|
||||
|
@@ -28,16 +28,13 @@ class Graphic3d_StructureManager;
|
||||
class Graphic3d_Structure;
|
||||
class Graphic3d_DataStructureManager;
|
||||
|
||||
|
||||
class PrsMgr_Prs;
|
||||
DEFINE_STANDARD_HANDLE(PrsMgr_Prs, Prs3d_Presentation)
|
||||
|
||||
|
||||
class PrsMgr_Prs : public Prs3d_Presentation
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT PrsMgr_Prs(const Handle(Graphic3d_StructureManager)& theStructManager, const PrsMgr_PresentationPointer& thePresentation, const PrsMgr_TypeOfPresentation3d theTypeOfPresentation3d);
|
||||
|
||||
@@ -51,8 +48,9 @@ public:
|
||||
//! We have to take in account this Transformation
|
||||
//! in the computation of hidden line removal...
|
||||
//! returns a filled Graphic Structure.
|
||||
Standard_EXPORT Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, const TColStd_Array2OfReal& AMatrix) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
|
||||
const Handle(Geom_Transformation)& theTrsf) Standard_OVERRIDE;
|
||||
|
||||
//! No need to return a structure, just to fill
|
||||
//! <ComputedStruct> ....
|
||||
Standard_EXPORT void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, Handle(Graphic3d_Structure)& ComputedStruct) Standard_OVERRIDE;
|
||||
@@ -60,30 +58,16 @@ public:
|
||||
//! No Need to return a Structure, just to
|
||||
//! Fill <aStructure>. The Trsf has to be taken in account
|
||||
//! in the computation (Rotation Part....)
|
||||
Standard_EXPORT void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, const TColStd_Array2OfReal& AMatrix, Handle(Graphic3d_Structure)& aStructure) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
|
||||
const Handle(Geom_Transformation)& theTrsf,
|
||||
Handle(Graphic3d_Structure)& theStructure) Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(PrsMgr_Prs,Prs3d_Presentation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
PrsMgr_PresentationPointer myPresentation3d;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _PrsMgr_Prs_HeaderFile
|
||||
|
Reference in New Issue
Block a user