Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when compile LinkDev #1

Closed
dulouie opened this issue Mar 3, 2018 · 14 comments
Closed

error when compile LinkDev #1

dulouie opened this issue Mar 3, 2018 · 14 comments

Comments

@dulouie
Copy link

dulouie commented Mar 3, 2018

hi realthunder i want to look at your newested development progress. But a few days ago i get this error.

/src/FreeCADLinkDev/src/Mod/Part/App/PropertyTopoShape.cpp: In member function 'void Part::ShapeHistory::reset(BRepBuilderAPI_MakeShape&, TopAbs_ShapeEnum, const TopoDS_Shape&, const TopoDS_Shape&)':
/src/FreeCADLinkDev/src/Mod/Part/App/PropertyTopoShape.cpp:435:44: error: aggregate 'TopTools_ListIteratorOfListOfShape it' has incomplete type and cannot be defined
         TopTools_ListIteratorOfListOfShape it;
                                            ^~
make[2]: *** [src/Mod/Part/App/CMakeFiles/Part.dir/build.make:1399: src/Mod/Part/App/CMakeFiles/Part.dir/PropertyTopoShape.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1731: src/Mod/Part/App/CMakeFiles/Part.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

i think these include can fix it:
#include <TopTools_ListIteratorOfListOfShape.hxx>

And you are on the right way with asm3 thank you.

@dulouie dulouie changed the title error when complie LinkDev error when compile LinkDev Mar 3, 2018
@realthunder
Copy link
Owner

Fixed now. However, be warned that LinkDev is under heavy change these few days. Lots of rebase there. I am taking on the topological naming issue. Still testing now, but expect to release a new version along with asm3 soon.

@dulouie
Copy link
Author

dulouie commented Mar 3, 2018

Your new 2-pass-recompute is very interesting for me, because a few month ago i tried to change the shapebinder placement. I know you have created a new subshapebinder but it is not exactly what i want.
Look at my old thread what i mean: https://forum.freecadweb.org/viewtopic.php?t=25168

Here are my placement changes: https://github.com/dulouie/FreeCAD/blob/shapebinder/src/Mod/PartDesign/App/ShapeBinder.cpp

Do you think it is now possible to get my shapebinder working without dependency loop?
ps: i'm not a programmer expert but try my best

@realthunder
Copy link
Owner

I am afraid it is not that useful in your case. In my use case, the parent is actually aware of the dependency inversion. It is the parent who updates the children, which violates the FC dependency order. My patch allows the parent to skip the update in the second pass to avoid infinite loop.

But in your case, the parent is not aware of the inversion. The children has no way to make sure that after it's been recomputed, its parent's placement remains the same. FC always recompute children first, then parent.

I am not sure if I get your intention, but why not create another Body, and bring in the other two bodies with shape binder. With my new shape binder, you can choose whether to follow the other two bodies placement or not.

@realthunder
Copy link
Owner

realthunder commented Mar 4, 2018

There is a possible way around. You'll need to create some kind of private observer (see class DocumentObserver) object to watch the parent's property change. And update your shape binder's placement whenever the parent one changes. Then, my two pass recompute may work for you, assuming the parent's placement is not calculated using its children (it might!).

That being said. I still recommend against what you are doing. Create another parent body should be the way to go.

@dulouie
Copy link
Author

dulouie commented Mar 6, 2018

Basically i want to reference from one body to another body. Which is not allowed in current FreeCAD. The shapebinder is the helper tool for doing something like that, but it has some disavantages. It don't get the placement of the feature in the reference body in relation to the active body.
I figured out, it is a difference to get a shapebinder from the reference body or a reference feature.
When you get it from the feature, the placement is not relative to you but when you get it from the body, it is relative to you like your subshapebinder. (edit: and the parents group)
The problem is, that the placement is only relative to the origin (0,0,0) and not to the placement of the body that own the shapebinder.

Look here:
Shapebinder_relative2

My intension was to calculate the placement from the reference body to active body with a codeline like that:

placement = placementActiveBody.inverse() * placementReference;

And then i make the placement of the shapebinder constant. So if the placement from the reference changed, it doesn't matter the shapebinder. It is like a snapshot at the moment when you create the shapebinder. So maybe i have no problems with depency loops and recompute, but I don't know much about it.

To illustrate that, here a next video:

Shapebinder_relative2
[edit: video works now]

Another idea is to make it not permanent, like the shapebinder from reference body above or your subshapebinder. When the reference placement changed, it has to recompute the children and parents with recompute problems, when i use my methode.
Maybe you understand my intension now, what you think about it?
I think to create another parent body can not solve my problem.

@dulouie dulouie closed this as completed Mar 7, 2018
@dulouie dulouie reopened this Mar 7, 2018
@realthunder
Copy link
Owner

Yeah, I think my previous understanding of your intention is correct. Let me ask you a question. If you can now add a body directly to another body, can you get what you want without using shape binder?

@dulouie
Copy link
Author

dulouie commented Mar 7, 2018

Yes i can use a clone to add a body directly to another body, but this is not what i want.
My vision is a similar workflow in FreeCAD like Design-In-Context on Onshape.
https://www.onshape.com/videos/design-in-context
Get sketch references from other body's with correct placement.

@realthunder
Copy link
Owner

realthunder commented Mar 8, 2018

Ah... very nice video! I think we should create a forum thread for this, as some possible future direction of FC.

Back to the topic. You do realize that the 'context' in the video is established in the 'assembly', not any of the individual parts. And that 'assembly' is exactly what I suggested you to create, a 'super' body. But I do realise that current Body do not support in-place editing like what's shown in the video. So, apparently the 'Body' is not the right container for this.

But hey, you are on my branch. Why not try my asm3 workbench. The assembly container there can be used for this purpose. And it supports in-place editing similar to what's shown in the video.

Be warned though, Shapebinder is not the right object to use in this case. You should use datum object. This is kind of chicken and egg situation. And I am sure OnShape does similar thing. Here is the workflow. Suppose you have two roughly designed bodies. You put them in the assembly and constraint their positions. In order to further refine, say body A, in context of body B's placement in the assembly. You can create datum object in body A that has the same placement of body B's geometry element in the assembly context. And you can continue your model refinement. The datum creation command needs modification to support that. I'll soon add a patch for you to test.

The reason to use datum object instead of shape binder is because datum object is detached from the other object. When your model involve, its constraining element in the assembly may change. So its context may change, too. If you use shape binder to bring in the context, it is a cyclic dependency right there.

What happens in the end is that, when you bring in more context, and your model continues to involve, you will gradually change your assembly's constraining element to those very datum object you created. That's optional, of course, but a good assembly practice nevertheless. Can you see the chicken and egg analogy here?

your bodies existing geometry element -> assembly constraining element -> datum object in context -> body geometry element changes due to refinement -> change assembly constraining element to those datum objects.

@dulouie
Copy link
Author

dulouie commented Mar 8, 2018

I'm happy to hear you are also interested in this. Sure on my try to change shapebinder placement i forgot the 'super' body or assembly container. These makes sense and all other what you are say. With my limited freecadcode experience i used the shapebinder but datum objects makes more sense.
We can hack this together and i can't wait to test your next patch:)

btw: Some time ago i ask you about saso's proposal about to remove the local coordinatesystem from the body. Maybe this is relevant to in-context-design. All body's inherit the CS from the parent assembly. Is this relevant? (Edit: Maybe it's better to not touch the body, when i assume the discussion about it. My vision is Partdesign with in-context-editing and your asm3. And all tool interact in a clever way with no redundant tools or containers)

(edit: forum thread: https://forum.freecadweb.org/viewtopic.php?f=8&t=27340)

@realthunder
Copy link
Owner

Some time ago i ask you about saso's proposal about to remove the local coordinatesystem from the body. Maybe this is relevant to in-context-design

The video you posted is a different use case than what's shown in saso's video. saso's video is about designing one fixed part with multiple bodies. What OnShape video shows is designing a part in the context of its assembly position.

@dulouie
Copy link
Author

dulouie commented Mar 9, 2018

Well, maybe the same usecase for a assembly object that own the one and only coordinate system. This is just a brainstorming.

@dulouie dulouie closed this as completed Mar 9, 2018
@dulouie dulouie reopened this May 24, 2018
@dulouie
Copy link
Author

dulouie commented May 24, 2018

ATM i can't compile LinkStage3 or LinkDev:

/usr/include/c++/8.1.0/bits/stl_tree.h: In instantiation of ‘class std::_Rb_tree<const SMDS_MeshNode*, std::pair<const SMDS_MeshNode* const, const SMDS_MeshNode*>, std::_Select1st<std::pair<const SMDS_MeshNode* const, const SMDS_MeshNode*> >, TIDCompare, std::allocator<std::pair<const SMDS_MeshNode* const, const SMDS_MeshNode*> > >’: /usr/include/c++/8.1.0/bits/stl_map.h:151:17: required from ‘class std::map<const SMDS_MeshNode*, const SMDS_MeshNode*, TIDCompare>’ /home/arne/src/FreeCADLink/src/3rdParty/salomesmesh/inc/StdMeshers_Projection_2D.hxx:68:44: required from here /usr/include/c++/8.1.0/bits/stl_tree.h:452:21: error: static assertion failed: comparison object must be invocable with two arguments of key type static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{}, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/8.1.0/bits/stl_tree.h: In instantiation of ‘class std::_Rb_tree<const SMDS_MeshNode*, const SMDS_MeshNode*, std::_Identity<const SMDS_MeshNode*>, TIDCompare, std::allocator<const SMDS_MeshNode*> >’: /usr/include/c++/8.1.0/bits/stl_set.h:133:17: required from ‘class std::set<const SMDS_MeshNode*, TIDCompare>’ /home/arne/src/FreeCADLink/src/3rdParty/salomesmesh/inc/SMESH_MesherHelper.hxx:716:24: required from here /usr/include/c++/8.1.0/bits/stl_tree.h:452:21: error: static assertion failed: comparison object must be invocable with two arguments of key type make[2]: *** [src/3rdParty/salomesmesh/CMakeFiles/StdMeshers.dir/build.make:570: src/3rdParty/salomesmesh/CMakeFiles/StdMeshers.dir/src/StdMeshers/StdMeshers_Projection_1D2D.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:468: src/3rdParty/salomesmesh/CMakeFiles/StdMeshers.dir/all] Error 2 make: *** [Makefile:130: all] Error 2
Compiling FreeCAD 0.18 git master works well, so what is my mistake? Can you compile one of your branches?

@realthunder
Copy link
Owner

Yes, I can compile. The error reported is from a third party library. I didn't touch anything there. Besides, I checked code there, and the error doesn't make sense. Maybe you try a clean build and see.

@dulouie
Copy link
Author

dulouie commented May 25, 2018

the problem is gcc 8.1 and the discussion about it here: https://forum.freecadweb.org/viewtopic.php?t=27399

@dulouie dulouie closed this as completed May 25, 2018
realthunder pushed a commit that referenced this issue Nov 6, 2018
realthunder pushed a commit that referenced this issue May 5, 2019
realthunder pushed a commit that referenced this issue Mar 20, 2020
4th-axis fixes and improvements
realthunder pushed a commit that referenced this issue Apr 27, 2020
Path: Fix `ZigZag` pattern; Remove some comments
realthunder pushed a commit that referenced this issue May 22, 2020
Path: Extend fix to `updateVisibility()`
realthunder pushed a commit that referenced this issue Oct 15, 2020
realthunder pushed a commit that referenced this issue Feb 28, 2021
Fixes Coverity issue:
CID 316539 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member lastHasPartialRedundancies is not initialized in this constructor nor in any functions that it calls.
realthunder pushed a commit that referenced this issue Feb 28, 2021
Coverity warnings fixed:

CID 316517 (#1 of 1): Uninitialized scalar variable (UNINIT)
13. uninit_use_in_call: Using uninitialized value t. Field t.err is uninitialized when calling push_back

CID 316519 (#1 of 1): Uninitialized scalar variable (UNINIT)
3. uninit_use_in_call: Using uninitialized value v. Field v.tstart is uninitialized when calling push_back

CID 316547 (#1 of 1): Uninitialized scalar variable (UNINIT)
13. uninit_use_in_call: Using uninitialized value t. Field t.err is uninitialized when calling push_back

CID 316556 (#1 of 1): Uninitialized scalar variable (UNINIT)
3. uninit_use_in_call: Using uninitialized value v. Field v.tstart is uninitialized when calling push_back
realthunder pushed a commit that referenced this issue Feb 28, 2021
Coverity warnings fixed:

CID 316550 (#1 of 1): Uninitialized scalar variable (UNINIT)
13. uninit_use_in_call: Using uninitialized value sel. Field sel.pResolvedObject is uninitialized when calling push_back
realthunder pushed a commit that referenced this issue Feb 28, 2021
Coverity warnings fixed:

CID 316559 (#1 of 1): Uninitialized scalar variable (UNINIT)
3. uninit_use_in_call: Using uninitialized value we. Field we.idx is uninitialized when calling push_back

CID 316549 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member pageheight is not initialized in this constructor nor in any functions that it calls.

CID 186161 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member parent is not initialized in this constructor nor in any functions that it calls.

CID 305170 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking this->m_baseFeat suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

CID 186152 (#2 of 2): Uninitialized pointer field (UNINIT_CTOR)
3. uninit_member: Non-static class member m_mdi is not initialized in this constructor nor in any functions that it calls.

CID 192588 (#1 of 1): Same on both sides (CONSTANT_EXPRESSION_RESULT)
pointless_expression
realthunder pushed a commit that referenced this issue Feb 28, 2021
Coverity warnings fixed:

CID 305123 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach the expression this->linked inside this statement: if (role == Qt::TextColorRole && linked)
realthunder pushed a commit that referenced this issue Feb 28, 2021
Coverity warnings fixed:

CID 129530 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member pixelScalingFactor is not initialized in this constructor nor in any functions that it calls.
realthunder pushed a commit that referenced this issue Sep 24, 2021
Prevent matplotlib selecting the PyQt API instead of PySide2
realthunder pushed a commit that referenced this issue Jan 24, 2022
realthunder pushed a commit that referenced this issue Feb 19, 2022
realthunder pushed a commit that referenced this issue Jul 15, 2023
@yahbluez yahbluez mentioned this issue Jan 18, 2024
2 tasks
realthunder pushed a commit that referenced this issue Apr 20, 2024
The proposed code fixes the following issues:
1. There is no check if the target object itself has a property that matches the label type.
2. If a subelement is selected that does not have the label type property, the value from the main object is displayed instead.
3. The default text is an empty string.

Example:

Currently If you select a vertex of a wire, and select "Length" as the label type, you will get the length of the wire. With the new code the text will then be "Length not available for (sub)object".

Forum topic (issue #1):
https://forum.freecad.org/viewtopic.php?t=86222
@fatihyaman661 fatihyaman661 mentioned this issue May 18, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants