I made the following classes:
IModel_Document is a subclass of ActData_BaseModel
class IPoint_Partition is a subclass of ActData_BasePartition
class IPoint_Node is a subclass of ActData_BaseNode
int main()
{
Handle(IModel_Document) model = new IModel_Document;
qDebug() << model->NewEmpty();
Handle(IPoint_Node)
aPointNode1 = Handle(IPoint_Node):
ownCast( IPoint_Node::Instance() );
Handle(IPoint_Node)
aPointNode2 = Handle(IPoint_Node):
ownCast( IPoint_Node::Instance() );
model->OpenCommand();
model->StubIPoint_Partition()->AddNode(aPointNode1);
model->StubIPoint_Partition()->AddNode(aPointNode2);
BRepPrimAPI_MakeWedge aWedgeMaker (100, 100, 100, 50);
auto shape = aWedgeMaker.Shape();
aPointNode1->Init(shape, shape, 12.3);
aPointNode2->Init(shape, shape, 0.0);
aPointNode1->AddChildNode(aPointNode2);
model->CommitCommand();
qDebug() << aPointNode1->IsWellFormed(); // true
qDebug() << aPointNode2->IsWellFormed(); // true
qDebug() << aPointNode1->DynamicType()->Name() ; // IPoint_Node
auto aFilename = std::string("D:\\activeDataModel.cbf");
qDebug() << aFilename.c_str();
TCollection_AsciiString filename = aFilename.c_str();
qDebug() << model->SaveAs(filename); // false
model->Release();
}
model refuses to be saved. What am I doing wrong ?