Would-be documentation OCC 5.0

Hi anyone,

did anyone read that "great" so-called "Visualization User´s Guide" ?
There is a so-called "example" on page 85. As usually with all OCC-examples in that "User´s Guide", it does not compile proper and is full of mistakes.
Besides, there are no include-files mentioned as usually in that glorious chapters of visualization.

Here is my Code:







int main()
Handle(Graphic3d_GraphicDevice) myGraphDevice = new Graphic3d_GraphicDevice("");
Handle(V3d_Viewer) myViewer = new V3d_Viewer(myGraphDevice, 400., V3d_Xpos, Quantity_NOC_DARKVIOLET, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT);

Handle(Graphic3d_Structure) s = new Graphic3d_Structure(myViewer->Viewer());


Handle(Graphic3d_Group) myGroup = new Graphic3d_Group(s);

Graphic3d_Array1OfVertex Points(0,3);

Handle(V3d_AmbientLight) L1 = new V3d_AmbientLight(myViewer,Quantity_NOC_GRAY50);
Handle(V3d_DirectionalLight) L2 = new V3d_DirectionalLight(myViewer,V3d_XnegYnegZneg,Quantity_NOC_WHITE);

Handle(Xw_Window) w = new Xw_Window(myGraphDevice,"Test V3d",0.5,0.5,0.5,0.5);


Handle(V3d_PerspectiveView) v = new V3d_PerspectiveView(myViewer);






return 0;


Here are the compiler-errors (gcc-2.95.3):

V3d.cc: In function `int main()':
V3d.cc:26: no matching function for call to `V3d_Viewer::V3d_Viewer (Handle_Graphic3d_GraphicDevice &, double, V3d_TypeOfOrientation, Quantity_NameOfColor, V3d_TypeOfVisualization, V3d_TypeOfShadingModel, V3d_TypeOfUpdate)'
/opt/OpenCASCADE-50/ros/inc/V3d_Viewer.hxx:178: candidates are: V3d_Viewer::V3d_Viewer(const Handle_Aspect_GraphicDevice &, short int *, char * = "", double = 0x000000000000000000fa0840, V3d_TypeOfOrientation = V3d_XposYnegZpos, Quantity_NameOfColor = Quantity_NOC_GRAY30, V3d_TypeOfVisualization = V3d_ZBUFFER, V3d_TypeOfShadingModel = V3d_GOURAUD, V3d_TypeOfUpdate = V3d_WAIT, unsigned int = 1, unsigned int = 1, V3d_TypeOfSurfaceDetail = V3d_TEX_NONE)
/opt/OpenCASCADE-50/ros/inc/V3d_Viewer.hxx:348: V3d_Viewer::V3d_Viewer(const V3d_Viewer &)
V3d.cc:63: `Normal' undeclared (first use this function)
V3d.cc:63: (Each undeclared identifier is reported only once
V3d.cc:63: for each function it appears in.)

That is a total knock out and I am clueless what to do. What to include else ? Why did that clown who wrote that "paper" not include anything ?

That does not help to distribute OCC 5.0 in the industrial world.

Could anyone help ???

Forum supervisor's picture


Consult dozen samples supplied with Open CASCADE on how to
enable 3D view in your application. You may choose among
MFC, Qt and Java implementations.

Obviously, documentation may contain some code and omits
the #include directives for better code readability. Moreover,
including a complete code of ALL files of the sample (which
sometimes can be numerous) would only worsen compehension
as well.
Anyway, samples should be considered as a primary reference.

Forum supervisor

MCV's picture

Great, that does not help at all !

thank you indeed !


MCV's picture

By the way, excuse me but your argumentation is totally wrong. It would help anyone of us to understand and follow the examples and deepen our understanding, if you would have provided us with compilable examples. And it would not have been a big thing for you, not in terms of time or extra space, to write down the includes that you used during the example. To us it means hours of lost time of exploring and reconstructing what the authors could have meant. I am not talking about the tutorial. there you are totally right. But all other (small and medium sized) examples need the includes.
In some chapters, they were included. It is only this Visualization and 3D manual, that the author was too lazy or unmotivated at work.

So thanks indeed for your standard reply.
It does not help to block out reality. Just have a decent look at the questions on the forum, how many problems could have been avoided. Look at the whole forum, how many hours and useless costs have been wasted only because some guy did not want to work properly for the manuals.
That makes the really bad image of OpenSource. Sadly so, and unnecessary. Because OpenSource and OpenCascade are a great idea !

Best Regards


Forum supervisor's picture

Hello Christian,

Code excerpts given in the documentation are not supposed to
compile as standalone applications - for example, it would be
much overhead to include compiler/linker instructions, MSVS
project files, etc. Indeed, these excerpts are only to underline
the concept of the demonstrated function, class or algorithm.
This is an approach used in most guides on programming and
we definitively follow it. Certainly, we realize this approach may
mismatch somebody's opinion who prefers a complete code
(this seems to be your case).

Nonetheless, as mentioned before (including by other
community users), working versions (compilable and running)
are available as numerous examples in the delivery. You may
find them under $CASROOT/../samples. Depending on the
platform you use you will find MFC, Qt and Java
implementations. They should be used as full-fledged samples
(with include directives, compiler options, etc).

Thank you for your comprehension.

Forum supervisor