Saveas problem

Hi:

When I try to save my data to a1.sta. It always crash. But, it is very strange. When I execute my program, again; then, open a1.sta. The a1.sta is exactly the data I want to save it. Does anyone know what wrong it is? I try to figure it out. Currently, I couldn't. Thanks.

PS. I am using Opencascade 4.0

Best regards,
Shawn

t-haller's picture

Hi,

Do you use OCC 4.0 on a NT4.0 or Win98/ME system?

Shawn Yang's picture

Hi:
Window2000

Best regards,
Shawn

t-haller's picture

I work with Win2000 too and there are nor major problems with saving and restoring.
You can try to use the patches I made for the 2 files:
CDF_Store.cxx
OSD_Path.cxx

You can find them in the CVS repository.

There seems to be at least one more bug with NT 4.0 (only on some systems). I hope I will find it the next days.

Shawn Yang's picture

Dear Thomas:
I tell you something I have done.
I split my view to be four views. Two of them are V3d_Viewer and the other are CTreeView. Usually, the "myStarsDoc->Main()" is Child 1. I use the following code to get(create) Child 2 and Child 3.
Handle(TDF_Data) TD = myStarsDoc->GetData();
TDF_Label L2 = TD->Root().FindChild(2, Standard_True);
TDF_Label L3 = TD->Root().FindChild(3, Standard_True);

Therefore, in OCAF, I can have the structure as following:

Root
|
---Child 1
| |....
|
---Child 2
| |....
|
---Child 3
|...

This structure is fine for V3.0. I need change it to V4.0. Because SetWidth() problem (I have post to forum) is fixed by MATRA on V4.0.

My original thought is Plugin and resources problem. It seems it is not. Because I just copied from the sampleOCAF.

You said you make two files. I don't really understand your meaning. Does it mean you modify CDF_Store.cxx and OSD_Path.cxx files and put them in you program(workspace) or you redo the dll files? If yes. Can you send them to be? My email is shawn@git.com.tw. I am very appreciated for your help. I am still trying it. If I get it. I will post it on the forum. Thanks a lot.

Best regards,
Shawn

David Jorge's picture

Hi Shawn, i'm developing a small aplication using OpenCascade. Like other cad systems, i'd like to code the 4 views (top,left,...) plus one Ctree for organization of the model.

i'm using OCAF in my CAD systems. What's the best strategy todo this?

Do i have to add 1 attribute per view?
Each view is a V3d_Viewer? Do i have to add this
V3d_Viewer to the OCAF Tree as a label/attribute?

Can you share you code?

Shawn Yang's picture

Dear Sir:

I don't think the V3d_View is part of label/attribute. But, OCAF has relationship with it like AIS_InteractiveContext. In OCAF, it store AIS_InteractiveContext using TPrsStd_AISViewer attribute. When you want to display the shapes to different views. You have to switch the AIS_InteractiveContext. I think you know when you create different views that have different AIS_InteractiveContext. Wish it help you.

PS. The TPrsStd_AISViewer must be(ONLY) stroed in root of OCAF; not in the main() of TDocStd_Document. The main() is FindChild(1); not root.

Shawn

Sofia Gameiro's picture

Dear Thomas

I have a similar problem with open cascade ocaf 5.0 working with visual c++ 6.0 in Windowns NT.
Whenever I try to open a saved document the application crashes.

Can you help me with this?

Thanks in advance, Sofia Gameiro