Hi to All,
I have a problem about changing external referans position on master map.
I have crated new external referance and added succesfulluf to db but Iââ¬â¢m unable to set right position
on master flt.
I think that I couldn't set transformation matrix on new node.
You can see the code below.
static mgbool set_pos (mgrec* db, mgrec* parent, mgrec* rec, void* userData)
{
mgrec* scale;
mgrec* translate;
mgmatrix matrix;
mgmatrix temp_matrix;
char formatString[50];
int fieldWidth = 8;
char* name = mgGetName (rec);
int val = mgGetCode(rec);
char *xref_model_filename;
int found;
if(val == eFltXref)
mgGetAttList(rec,
fltXrefFilename,&xref;_model_filename,
fltMatrix, temp_matrix,
mgNULL);
mgWalkGetMatrix (userData, &matrix;);
std::string path = xref_model_filename;
mgmatrix mymatrix_temp;
// Get current matrix
mgMatrixCopy(&mymatrix;_temp,matrix);
mgDelete (rec);
mgrec *xrec = mgNewRec(fltXref);
mgSetAttList(xrec,fltXrefFilename,path.c_str(),MG_NULL);
// Problem about setting thr transformation matrix
mgSetAttList(xrec,fltXmTranslate,mymatrix_temp,MG_NULL);
mgAttach(parent,xrec);
mgWriteDb(db);
}
This is a common question.
You can check out this related API forum topic: support/discussions/topics/968 for more information.
Craig
Hi to All,
I have a problem about changing external referans position on master map.
I have crated new external referance and added succesfulluf to db but Iââ¬â¢m unable to set right position
on master flt.
I think that I couldn't set transformation matrix on new node.
You can see the code below.
static mgbool set_pos (mgrec* db, mgrec* parent, mgrec* rec, void* userData)
{
mgrec* scale;
mgrec* translate;
mgmatrix matrix;
mgmatrix temp_matrix;
char formatString[50];
int fieldWidth = 8;
char* name = mgGetName (rec);
int val = mgGetCode(rec);
char *xref_model_filename;
int found;
if(val == eFltXref)
{
mgGetAttList(rec,
fltXrefFilename,&xref;_model_filename,
fltMatrix, temp_matrix,
mgNULL);
mgWalkGetMatrix (userData, &matrix;);
std::string path = xref_model_filename;
mgmatrix mymatrix_temp;
// Get current matrix
mgMatrixCopy(&mymatrix;_temp,matrix);
mgDelete (rec);
mgrec *xrec = mgNewRec(fltXref);
mgSetAttList(xrec,fltXrefFilename,path.c_str(),MG_NULL);
// Problem about setting thr transformation matrix
mgSetAttList(xrec,fltXmTranslate,mymatrix_temp,MG_NULL);
mgAttach(parent,xrec);
mgWriteDb(db);
}