Possible optimization AIS_InteractiveContext.SetLocation

Forums: 

Possible optimization

I tried to change the transform of the underling Graphic3d_CStructure
However changing the rendering transform over the InteractiveContext has some unnecessary overhead.

Best option would be to use a cheap value class (gp_Trsf) in the call, but:

---

AIS_InteractiveContext.SetLocation uses a TopLoc_Location object as parameter but internally only uses its gp_Trsf.
The TopLoc_Location is expensive to construct.
Bypassing to AIS_Shape.SetLocalTransformation(gp_Trsf) omits update of selection transforms.
Possible optimization:
Allow SetLocation with parameter gp_Trsf. TopLoc_Location implicit casts

---

The Prs3d_Presentation forwards to the Graphic3d_CStructure (functions Transform(), Move(), etc) by using a Handle(Geom_Transformation) and calling new inside.
This seems unnecessary as the usage of the Handle is only local and all the data is copied, so nothing gets shared.
Possible optimization:
Replace Handle(Geom_Transformation) with gp_Trsf

This would save several unnecessary memory allocations.

Kirill Gavrilov's picture

AIS_InteractiveContext.SetLocation uses a TopLoc_Location object as parameter but internally only uses its gp_Trsf.

AIS_InteractiveContext::SetLocation() takes TopLoc_Location for historical reasons - of course it would be more straightforward if there will be also method taking gp_Trsf. This patch will be welcome.
But I doubt it will have any performance effect.

The Prs3d_Presentation forwards to the Graphic3d_CStructure (functions Transform(), Move(), etc) by using a Handle(Geom_Transformation) and calling new inside.
This seems unnecessary as the usage of the Handle is only local and all the data is copied, so nothing gets shared.

The transformation is shared across different presentations of the same presentable object. Dynamic allocation should not be much problem here because PrsMgr_PresentableObject is very heavy object anyway.

Mikael Aronsson's picture

Hi !

The reason that I wanted to make one big dll is that, it would take a lot of work to put together all the project files needed to create all the libraries, by making only one dll I only need one project file.

And when the next version is out I have to check all the project files again if some files have been added and so on.

Or is there an easy way to make the project files needed ? so far I have not found and easy way to do it.

Note: I have used precompiled header to compile the samples and my own code and so far I have not had any problems, is this only a problem when I compile the sorce files ?

Mikael

Sylvain Lecluze's picture

Hello,

dynamic load is possible with NT : add /DELAYLOAD:DLLNAME syntax to Projet Settings | Link for more information, see MSJ February 2000, chapter Under The Hood by Matt Pietrek or http://www.microsoft.com/msj/0200/hood/hood0200.asp

Sylvain