DiscussionsIssue archiveVisualization and 3D Viewer

Forum archive

Visualization and 3D Viewer

Technical discussions preserved from the public OCCT community forum.

Topics
627
Replies
1,764
Files
507

Discussions

Page 10 of 11

Showing 60 discussions, ordered by the latest archived activity.

Double buffer

Hi ! How can I use the double buffer on X11 ? For the moment, the 'Context::EraseAll()'/'Context::Display()' in a V3d_Viewer/V3d_View is obviously not efficient : there must be a unique method (like 'Update()') to refresh the graphic.. Should I use Visual3d_Viewer/Visual3d_View ? Or V3dView::Transie

2 replies

NOT zoomable objects

Hi everyone, Need to display 3d objects that must NOT zoomable. Any suggestion?

2 replies

Lazy Presentation Update

Hi! I am using OCAF and I am creating documents with attributes of our own types and our own presentation drivers. Some of these presentations are very costly to compute. Hiding attributes is implemented here as getting the TPrsStd_AISPresentation attribute that is related to the particular attribut

4 replies

Multi-sampling Issue

Hi, I am currently developing a viewer application using OpenCascade 7.3.0. I have based the initial framework off the WPF_D3D sample, using a D3DHost_View to update the source of a WPF D3DImage. I have been trying to enable Multisampling and when I change the NbMsaaSamples to a value greater than 0

1 reply1 file

Background Gradient

Good day. I have a problem with using background gradient. You can see it in the picture. I have 2d XY-rectangle instead background. I use Ubuntu, Qt widget. What can it be?

10 replies4 files

Set/Get the points of view.

Hi all. I want to save the specific position and magnification(focale?) in the 3D Viewer, and to see the shape in the 3D Viewer at the position and magnification that I saved when I wanted. I did the following, but did not get the right result. void 3d_viewer :: save_scene () { myView->Eye (m_eye_x,

2 replies

Find shape in view

hi I'm newbie in OCCT i have view and create some shape in it that listed in treeview .i want when i clicked on treeview item, color of the related shape changes. please help

1 reply

How to use OpenGL directly in OCC?

I need to read a *.stl file,then display the shape in my program. But the *.stl is so big, there are more than 10000 triangles in it. So if using the followed code to display. ...... while(...) { // Will cycle >10000 times. ......// Read data from a stl file. gp_Pnt aPnt1(vX1, vY1, vZ1); gp_Pnt aPnt

11 replies

Hide seam lines

Hi, This may be a rather simple issue, but I haven't found the solution anywhere. I'm drawing simple objects such as solid spheres or cylinders. I have set the number of iso lines to 0 because I want to show only the solid object. However, I am still getting lines -- for instance, in the case of a s

3 replies1 file

How to select vertex in occt7.3.0

what is the proper way of selecting a vertex from the view ? i use mContext->Select(true); in the left_mouse_down event handler and use mContext->Deactivate(); mContext->Activate(AIS_Shape::SelectionMode(TopAbs_VERTEX ), Standard_True); mContext->MoveTo(point.x, point.y, mView, true); in mouse_move

8 replies

change face color

Hi, I try to change face color, but it is always yellow. my code as following: TopoDS_Face aFace; Handle(AIS_Shape) bFace = new AIS_Shape(aFace); bFace->SetColor(Quantity_NOC_RED); myAISContext->Display(bFace); Thank you for your sharing!!

3 replies

TopAbs_VERTEX selection mode doesn't work

hi i use this code : mContext->Deactivate(); mContext->Activate(AIS_Shape::SelectionMode(TopAbs_EDGE)); for changing the selection mode , and it works for all these modes : TopAbs_COMPOUND, TopAbs_COMPSOLID, TopAbs_SOLID, TopAbs_SHELL, TopAbs_FACE, TopAbs_WIRE, TopAbs_EDGE, TopAbs_SHAPE and they are

1 reply

Changing the default highlight thickness when a face, edge or a shape is selected?

Hi, I want to increase the default highlight thickness when a face, edge or whole shape is selected. Handle(AIS_ColoredDrawer) selectionStyle = new AIS_ColoredDrawer(new Prs3d_Drawer()); Standard_ShortReal width = selectionStyle->LineAspect()->Aspect()->Width(); selectionStyle->LineAspect()->Aspect(

1 reply

Set Selection Color in OCCT 7.2.0

How do you set the selection color for objects in the interactive context in OCCT 7.2.0? I tried myAISContext-->SelectionStyle()-->SetColor(Quantity_NOC_ORANGE), but it didn't work. Thanks!!

3 replies

How to get the selected subshapes

Hello I can change the selection mode and select subshapes, but how do I get the selected subshapes, e.g. faces or vertices? I've tried this approach below, but now I'm stuck. Any help much appreciated :) int previousSelMode = 0; void SetSelectionMode(int selectionMode) { myAISContext()->CloseAllCon

4 replies

Display a line in view

Hello. How can I add a line to view? I need just a plain line, going from start to end, with a given line thickness.

1 reply

Arc and curve

Hi, Can anybody tell me the best way to draw an ARC in a 3D OCC window. I have origin point, start angle,sweep angle,primary & secondary axis length. Also, if I have an array of vertices how can I draw a curve passing through them? Thanks in advance, Amod

2 replies

How to rotate the whole scene?

Hello. I need to rotate the whole scene by using a mouse. I am a little bit confused by a variety of Rotate functions found in V3dView class: https://www.opencascade.com/doc/occt-7.3.0/refman/html/class_v3d___view.html I have found an example which just grabs mouse coordinates and directly places th

2 replies

Get 3D mouse position with the depth buffer

Hello, I'm trying to compute the "projected" 3D position of the mouse when it's hovering graphical objects (eg AIS_Shape). To this end I'm trying to use the depth buffer as explained in this article (though I'm concerned only with the orthographic case). To retrieve the depth buffer I'm calling V3d_

4 replies1 file

entity error

I am building a Viewer on top of a MFC application. I have OpenCascade installed and running in a MFC view. I am running into problems send geometry data to the view via a MFC document. If I create geometry from with the document everything is fine. But if I call for the creation of the same geometr

8 replies

Texturing in OpenCASCADE 6.5

Hi, I was hoping to be able to show a simple texture on some faces of my model. I had some difficulty getting the texture to show - seems the display mode must be higher than other object currently being used in the model for textures to show... Anyway, I have them showing now, but I expected the te

8 replies4 files

How to move an AIS_SHAPE????

Hi, I need help I tried to move a sphere which is an AIS_SHAPE but I didn't get it. I think maybe jooo can help me. Thanks

4 replies1 file

AIS_Shape::SetColor without changing boundary edges color

Hello! I have AIS_Shape in viewer with shading color (superColor) and black color of boundary edges. Then I do context->SetColor (aisShape, otherSuperColor) and my shape color changed to this color. But color of boundary edges changes color too. How can I change shading color and leave boundary colo

4 replies

AIS_ConnectedInteractive documentation wrong?

>>From AIS_ConnectedInteractive is an object instance, which reuses the geometry of the connected object but has its own transformation, material, visibility flag, etc. This connection is >>propagated down to OpenGl level, namely to OpenGl_Structure. OpenGl_Structure can be connected only to a singl

1 reply

Cocoa_Window throwing exception when built

Hello! I am extremely new to OpenCascade, but I am trying to get its base functionality integrated into my research. I have a simple Topo_DS_Shape object created, and I would like to open up a window and look at it. I don't need anything fancy for now, just a viewer window. So here is my initial att

2 replies1 file

Visual3d_layer text replacement

Hi, I am using Visual3D_Layer to manage rectangular zoom cursor and to display some entities information at the cursor position with OCC6.6.0. Now with OCC7.2.0 the Visual3D_Layer class was erased. For the Zoom cursor I am using the new AIS_RubberBand class. But, what can i use to dynamically displa

4 replies

Curves are not drawn correctly, displayed broken

I am trying to draw a curve but the result is unexpected ( OCC 6.9.0). I draw it with the help of AIS_InteractiveContext, but somehow it looks like broken, not a continuous curve. I separately tried something to solve it, but these have not solved my problem completely: 1 - I manually changed the De

1 reply2 files

LocalContext replacement

Hi all, I Have to replace the selection of subshapes (vertex,edge, face...) of a shape. Now i am using : myAISContext->OpenLocalContext(); myAISContext->ActivateStandardMode(TopAbs_VERTEX); but in 7.2 the localcontext was removed ! What is the best way to select the subshapes ?

1 reply

Bounding Box of objects in AIS_InteractiveContext

Hello, is there a way to get the bounding box (3D) of all displayed AIS_InteractiveObject's in a context? Or that from a single AIS_InteractiveObject (without having access to the BRep from which it was created)? Regards, Author

1 reply

OCCT + QOpenGLWidget (qt5.4.0)

How to embed OCCT in QOpenGLWidget? QOpenGLWidget is different from QGLWidget because uses a FBO to render the final image. I tried to embed OCCT in QOpenGLWidget but nothing shows. I think that's because QT and OCCT render in different buffers. I tried also to derive my own widget from generic QWid

7 replies

HasDetected never returning anything

Hi, I have OC 7.2 and a little app drawing the MakeBottle example and few extra primitive for testing. Now I'd like to detect a shape when the mouse moves around. Under my MouseMove function, I try this method but it's never true. void wxViewOC::mouseMoved(wxMouseEvent& event) { if (mContext->HasDet

2 replies

Any way to create a gizmo

Hello! I need to create a gizmo in the visualizer for selected objects. Something like in attached picture. Are there some general tips on how to do this with OpenCASCADE? Or at least how draw any shape on screen which will be attached to the "camera" and not changes its size when zoomed/rotated?

7 replies2 files

Manage selection and hilight of each node from shape's decomposition

Is it possible to manage selection and hilight of shape's decomposited nodes (from parent shape) without create specific AIS objects? I mean the folowing issue. Here some code. AISCtx()->InitDetected(); while (AISCtx()->MoreDetected()) { const TopoDS_Shape &shp = AISCtx()->DetectedShape(); // posibl

2 replies

How to give/retrieve a name for a AIS_Shape

I am just doing the bottle tutorial and it works great. How can I give a name to the bottle, and how to retrieve the name of the AIS_Shape? My application is using wxWidgets and so it is not based on OCAF documents. Is it possible?

3 replies

Wire Selection Harder Since OCC 7.0.0?

Hi, I have jumped from OCC 6.8.0 to OCC 7.0.0 and I have realized, that it is "harder" to highlight or select a wire in the 3D view. That means: when I have moved with the mouse into the area around the wire, it has been highlighted immediately with OCC 6.8.0, but now I have to point very precisely

2 replies

Shadows

Hi, I'm currently trying to add Ray tracing Shadows to my project but am having quite a bit of difficulty in doing so. So far I've been using the provided source demos and the online documentation to enable Shadows but I'm having a hard time figuring out how to actually turn it on or get it working.

5 replies1 file

AIS_TextLabel with background?

Hello, i am looking for the ability to render some text with a semi-transparent background (or background in general). I am not able to find any method on AIS_Textlabel which would fulfill that requirement. Is it possible? I want the text to be visible independently from the 3D Models that are also

1 reply

Shaded shapes with visible edges

How get 3d shaded shapes with visible edges? Could someone share c++ code fragment? Not interested in combination of two topods_shape ( wireframe + shaded):it's redoundant and slows the visualization Thanks in advance

1 reply

Crash when using ClearSelected

I am a newbie for opencascade. Firstly, I selected a shape from list control using SetSelected and it works. Then I select no item. It crashed in void AIS_LocalContext::UnhilightPicked (const Standard_Boolean theToUpdateViewer) function when calling ClearSelected(). The follow is the source. void CO

2 replies

Drawing shaded shapes with visible edges

Folks, I'm trying to draw shapes (TopoDS_Shape's) in a V3D view that are both shaded (have a color and a transparency) and show visible edges (in a different color). I've tried manipulating the AIS_Drawer returned by object->Attributes(), but nothing has worked. I have achieved the effect I'm lookin

5 replies

Lines with scalable thickness

Hello everyone! I need to make OCCT to draw lines with scalable thickness. Is there any standard methods in OpenCASCADE to do that ? I know that it can be solved using geometry shader like this: https://github.com/paulhoux/Cinder-Samples/tree/master/GeometryShader ​Any ideas ? Thanks.

5 replies

How to Create a right BSpline Face and show it?

I want to make a BSpline Face,then show it. My Codes like followed: GeomFill_FillingStyle fillType = GeomFill_StretchStyle; Handle(Geom_BSplineCurve) GL1 = BSpLine1; Handle(Geom_BSplineCurve) GL2 = BSpLine2; Handle(Geom_BSplineCurve) GL3 = BSpLine3; Handle(Geom_BSplineCurve) GL4 = BSpLine4; GeomFill

1 reply

How to get triangles vertices data in absolute coords for native OpenGL rendering?

Hi. For example, i have TopoDS_Shape and i have my own 3D engine on OpenGL. I need pure faces data, to put it into the VertexBuffer on GPU and draw it via OpenGl. (i don't use cascade viewer) I need: 1. Triangles collection of 3D model 2. 3 vertices data per each triangle (each triangle have 3 point

25 replies1 file

Issues Redrawing Polygon with Handle_Graphic3d_Group

Hi, Currently I can draw a polygon using the Handle_Graphics3d_Group->Polygon like so: Handle_Graphics3d_Group group; Graphic3d_Array1OfVertex topVertices(0, points.size() - 1); /* populate vertices from points*/ group->Polygon(topVertices, Graphic3d_TypeOfPolygon::Graphic3d_TOP_UNKNOWN, true); Howe

5 replies1 file

Orientation of visualization

Hello, If I read a STEP file that contains the model of a mug (see mug.png) and I try to represent it by the V3d_View with the parameters shown below, I get the view shown in view.png : aView->Camera()->SetCenter(centre); //Look-at point of the camera aView->Camera()->SetDirection(gp_Dir(-1., 0., 0.

2 replies2 files

How to receive notification of a selection change?

Hi, In my application, when a user selects an AIS_Object in the viewer, I would like to highlight a corresponding node in aTreeView gui control elsewhere in the UI. How can I receive notification that the user has selected (or deselected) and object in the viewer so that I can take external action (

4 replies

Copying Curve2d object

Helllo everyone, I am trying to make a copy of my AIS_Shape created from Geom2d_Curve, like this: gp_Pnt2d location(0.0, 0.0); gp_Circ2d circ2d(gp::OX2d(), 10.0); circ2d.SetLocation(location); double staangle = 10 * UB_PI / 180; double endangle = 100 * UB_PI / 180; Handle(Geom2d_TrimmedCurve) arc =

5 replies

Visual3d_Layer removed, but still in the documentation

Good morning, just for reporting that even if, starting from the OCC major version 7.0.0, the class Visual3d_Layer has been removed. the documentation (up to 7.1.0) is not updated (both pdf and html) Regards

1 reply1 file

AIS_InteractiveObject visual reference

Hello everyone, I have an object and I need to distribute it's copies across the scene. If there is a way to display AIS_InteractiveObject's reference to avoid copying the same objects ?

2 replies

TriedronDisplay -- blinking when using 7.1.0

Hello, I am using TriedronDisplay() function, with Redraw() function called every timer tick. It was all good during ver 6.8.0. But when using 7.1.0, The Trihedron starts blinking when Redraw() is called. How should I solve this? Thank you. Here is the Code: -----------------------------------------

5 replies

MakeEdge with Poly_Polygon3D

Hi, Guys! I'm try to create some lined shape with BRep_Builder. And after creating the resulting shape can't be Picked with StdSelect_ViewerSelector3d. It's don't working if I'm use BRep_Builder::MakeEdge with Poly_Polygon3D, but working on another curves. Object displayed, but can't be selected: Si

5 replies

OCC with openGL / openVR? (student project)

Hi, I'm currently involved in a student project. We'd like to try implementing some basic CAD functionality in VR. As a starting point we use a framework (rather a template) which is using openvr by valve. It uses OpenGL and therefore expects us to provide vertices for the visualization. The problem

3 replies

Perspective projection

Hello, I'm trying to make a perspective projection with the HLR algorithms. First, I define the position of the camera in the view and establish the projection type as Graphic3d_Camera::Projection_Perspective. Then I use a Prs3d_Projector to define the projection with the params predefined in the vi

9 replies7 files

V3d_View Up() method

Hello, In the documentation is said that the method Up() returns the vector giving the position of the high point. But, what is the high point? Thanks!

1 reply

AIS_Shape on multiple V3d_Viewers

Hello, Is it possible to draw one AIS_Shape on multiple V3d_Viewers? The point is that I've created several windows (each have it's own GL Context and OpenGl_GraphicDriver) and I need to display the same Shape with different projections. Furthermore I need the selection equally work in different win

4 replies

Transform TopoDS_Shape or the content or V3d_View into cv::Mat

Hello, Is there any way of passing from TopoDS_Shape to Mat(OpenCV) directly? I mean, without having to save images in external folders. Now, I'm doing it saving the content of the V3d_View as an image by the method::Dump and then reading it with OpenCV. However, the resolution of the saved image is

2 replies