Topological Naming (another take)

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Topological Naming (another take)

Post by ezzieyguywuf »

Posted a brief readme on the OccWrapper repository. I hope to add more info to the TopoManager repository too, to hopefully make my code a bit easier to understand.
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: Topological Naming (another take)

Post by tanderson69 »

ezzieyguywuf wrote: Tue Mar 27, 2018 3:19 am Posted a brief readme on the OccWrapper repository. I hope to add more info to the TopoManager repository too, to hopefully make my code a bit easier to understand.
occ containers comes up quite often. have you seen romans blog about standard allocators?
http://opencascade.blogspot.com/2011/11 ... rface.html
http://opencascade.blogspot.com/2012/11 ... art-2.html
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Topological Naming (another take)

Post by ezzieyguywuf »

tanderson69 wrote: Tue Mar 27, 2018 2:36 pm occ containers comes up quite often. have you seen romans blog about standard allocators?
http://opencascade.blogspot.com/2011/11 ... rface.html
http://opencascade.blogspot.com/2012/11 ... art-2.html
I had not seen those, thanks for posting. I think taking Roman's example and expanding it (or utilizing it straight up) would probably be a good idea for a better long-term OccWrapper solution.

As it stands, a planned improvement is to do away with, say, Occ::Solid::myFaces (which is a local std::vector of all of Occ::Solid's TopoDS_Face's), and move the getFaces method up to Occ::Shape.

The return type of getFaces will have to change from a constant reference to a plain copied vector. The Occ::Shape::getFaces method would then utilize TopExp::Map (or w/e) to construct a new vector each time it is called and return that vector.

This would result in more processing each time getFaces is called (since we'd had to loop through each face each time to create the vector), but would also mean that any TopoDS_Face's that are stored in a vector would essentially be transient. They'd be gone as soon as they go out of scope. This could effectively minimize the issue that Roman mentions in his blog post. That doesn't mean that we'd want to completely ignore his suggestion, though, as what I'm proposing would merely make things "a bit better" but not really "solve" them the way that OpenCasCade has done so internally.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Topological Naming (another take)

Post by triplus »

It looks like there are some header files missing. For example:

Code: Select all

src/Mod/Part/App/PropertyTopoShape.h:33:22: fatal error: OccSolid.h
src/Mod/Part/App/FeaturePartBox.cpp:30:27: fatal error: OccSolidMaker.h
src/Mod/Part/App/PropertyTopoShape.h:34:27: fatal error: ISolidManager.h
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Topological Naming (another take)

Post by ezzieyguywuf »

triplus wrote: Wed Mar 28, 2018 11:29 am It looks like there are some header files missing. For example:

Code: Select all

src/Mod/Part/App/PropertyTopoShape.h:33:22: fatal error: OccSolid.h
src/Mod/Part/App/FeaturePartBox.cpp:30:27: fatal error: OccSolidMaker.h
src/Mod/Part/App/PropertyTopoShape.h:34:27: fatal error: ISolidManager.h
What are you trying to compile? Can you post the full output?
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Topological Naming (another take)

Post by triplus »

ezzieyguywuf wrote: Mon Mar 19, 2018 11:42 pm I have a TopoManager branch of FreeCAD that shows these managers in action (I have not rebased against master in a week or two, please excuse my excitement to post this as soon as possible.)
This branch.
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Topological Naming (another take)

Post by ezzieyguywuf »

Ah, that’s because you need to download and compile OccWrapper and TopoManagers libraries, and then update CmakeLosts.txt to point to the right location. I can write a step by step when I’m back at my comp, sorry for the confusion.
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Topological Naming (another take)

Post by ezzieyguywuf »

triplus wrote: Wed Mar 28, 2018 2:37 pm
ezzieyguywuf wrote: Mon Mar 19, 2018 11:42 pm I have a TopoManager branch of FreeCAD that shows these managers in action (I have not rebased against master in a week or two, please excuse my excitement to post this as soon as possible.)
This branch.

I've updated the second post on this thread that gives a step-by-step on how to compile my TopoManagers branch of FreeCAD. I realize it may seem a bit convoluted, but I wanted to keep OccWrapper and TopoManagers as separate, distinct libraries from FreeCAD in order to allow me to more easily (and quickly) develop them.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Topological Naming (another take)

Post by triplus »

Thanks for the instructions. Will likely give it a try in next days.

P.S. As for the strategy to make others test your work. Likely current strategy isn't optimal. ;)
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Topological Naming (another take)

Post by ezzieyguywuf »

triplus wrote: Thu Mar 29, 2018 8:50 pm Thanks for the instructions. Will likely give it a try in next days.

P.S. As for the strategy to make others test your work. Likely current strategy isn't optimal. ;)
how would you suggest i improve this?
Post Reply