mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-18 14:27:39 +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:
@@ -433,14 +433,14 @@ Standard_Boolean OpenGl_View::addRaytraceStructure (const OpenGl_Structure*
|
||||
|
||||
// Get structure material
|
||||
OpenGl_RaytraceMaterial aDefaultMaterial;
|
||||
Standard_Boolean aResult = addRaytraceGroups (theStructure, aDefaultMaterial, &theStructure->Transformation, theGlContext);
|
||||
Standard_Boolean aResult = addRaytraceGroups (theStructure, aDefaultMaterial, theStructure->Transformation(), theGlContext);
|
||||
|
||||
// Process all connected OpenGL structures
|
||||
const OpenGl_Structure* anInstanced = theStructure->InstancedStructure();
|
||||
|
||||
if (anInstanced != NULL && anInstanced->IsRaytracable())
|
||||
{
|
||||
aResult &= addRaytraceGroups (anInstanced, aDefaultMaterial, &theStructure->Transformation, theGlContext);
|
||||
aResult &= addRaytraceGroups (anInstanced, aDefaultMaterial, theStructure->Transformation(), theGlContext);
|
||||
}
|
||||
|
||||
myStructureStates[theStructure] = StructState (theStructure);
|
||||
@@ -454,9 +454,10 @@ Standard_Boolean OpenGl_View::addRaytraceStructure (const OpenGl_Structure*
|
||||
// =======================================================================
|
||||
Standard_Boolean OpenGl_View::addRaytraceGroups (const OpenGl_Structure* theStructure,
|
||||
const OpenGl_RaytraceMaterial& theStructMat,
|
||||
const Graphic3d_Mat4* theTransform,
|
||||
const Handle(Geom_Transformation)& theTrsf,
|
||||
const Handle(OpenGl_Context)& theGlContext)
|
||||
{
|
||||
OpenGl_Mat4 aMat4;
|
||||
for (OpenGl_Structure::GroupIterator aGroupIter (theStructure->Groups()); aGroupIter.More(); aGroupIter.Next())
|
||||
{
|
||||
// Get group material
|
||||
@@ -500,9 +501,10 @@ Standard_Boolean OpenGl_View::addRaytraceGroups (const OpenGl_Structure*
|
||||
|
||||
BVH_Transform<Standard_ShortReal, 4>* aTransform = new BVH_Transform<Standard_ShortReal, 4>();
|
||||
|
||||
if (theTransform != NULL)
|
||||
if (!theTrsf.IsNull())
|
||||
{
|
||||
aTransform->SetTransform (*theTransform);
|
||||
theTrsf->Trsf().GetMat4 (aMat4);
|
||||
aTransform->SetTransform (aMat4);
|
||||
}
|
||||
|
||||
aSet->SetProperties (aTransform);
|
||||
@@ -521,9 +523,10 @@ Standard_Boolean OpenGl_View::addRaytraceGroups (const OpenGl_Structure*
|
||||
{
|
||||
BVH_Transform<Standard_ShortReal, 4>* aTransform = new BVH_Transform<Standard_ShortReal, 4>;
|
||||
|
||||
if (theTransform != NULL)
|
||||
if (!theTrsf.IsNull())
|
||||
{
|
||||
aTransform->SetTransform (*theTransform);
|
||||
theTrsf->Trsf().GetMat4 (aMat4);
|
||||
aTransform->SetTransform (aMat4);
|
||||
}
|
||||
|
||||
aSet->SetProperties (aTransform);
|
||||
|
Reference in New Issue
Block a user