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
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
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
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?
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,
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
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
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
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
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!!
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
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(
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!!
Hello. I'd like to translate a AIS_InteractiveObject on button press on a certain distance relative to it's position. I have came with the following code: std::vector<Handle(AIS_InteractiveObject)> privateSimpleRig; void performTestTranslocationOfCylinder(double xc, double yc, double zc) { gp_Trsf s
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
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
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
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_
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
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
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
>>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
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
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
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
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 ?
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
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
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
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?
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
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?
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
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.
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
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
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
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
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.
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
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
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
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.
Hello everyone! I want to create a geometry shader for drawing custom lines. To do that I need to pass custom attributes for each vertex to the shader. If there is a way to do that ?
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 (
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 =
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
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 ?
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: -----------------------------------------
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
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
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
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!
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
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