2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations
2024-06-03 05:46 PM
Hi,
We need a preview image of such things like line types, fills, building materials (such a thing like in the composite editor where the preview of the composite can be seen). Is there a way to get such things anyhow through the API?
Our ideas (but we miss certain steps):
1) Structures in the QGDrawing folder looks alike the structures used in the API describing line types, fills, etc., but we did not find a lib file which contains the implementation. Is there a way to get a lib file for the QGDrawing headers? It seems we could use this to solve some of our issues regarding the preview images, if we could build the solution, but linking fails.
2) We might be able to solve some of our topics if we could transform a VectorImage to a GX::Image, but so far we had no success to achieve it. Does anyone have any experience with it?
Solved! Go to Solution.
2024-06-04 07:08 AM
There are two examples in DG_Test example Add-On that can help you with this.
Example 1: DG_Test AddOn, BuildingMaterialDialog.cpp
It calls the SetTabFieldOwnerDrawFlag on a ListBox so the ListBoxTabFieldUpdate function will be called and you can draw whatever you want. Check the UpdateBuildingMatDrawTab and DrawBuildingMaterial function to see how to use actual pens and fills.
Example 2: DG_Test AddOn, UserItemDialog.cpp
This example uses a DG::UserItem that you can draw to. Check the UserItemUpdate function to see how it works. Combined with the previous example I think you can achieve your goal of drawing attribute previews to any dialogs.
2024-06-04 07:08 AM
There are two examples in DG_Test example Add-On that can help you with this.
Example 1: DG_Test AddOn, BuildingMaterialDialog.cpp
It calls the SetTabFieldOwnerDrawFlag on a ListBox so the ListBoxTabFieldUpdate function will be called and you can draw whatever you want. Check the UpdateBuildingMatDrawTab and DrawBuildingMaterial function to see how to use actual pens and fills.
Example 2: DG_Test AddOn, UserItemDialog.cpp
This example uses a DG::UserItem that you can draw to. Check the UserItemUpdate function to see how it works. Combined with the previous example I think you can achieve your goal of drawing attribute previews to any dialogs.
2024-06-05 04:32 PM
Thanks, it seems to solve our issues around the topic.