Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[V8i C++] Use of std::vector in mdl functions

$
0
0

I'm attempting to utilize a std::vector<DPoint3d> as a parameter to mdlLinear_extract() without success. Is this even possible? I'd trying to avoid using dlmSystem_mdlMalloc() type functions for allocating/freeing memory...

int	maxVerts=MAX_VERTICES;
mdlLinear_extract( NULL, &maxVerts, elHandle.GetElementP(), elHandle.GetModelRef() );
//std::vector<DPoint3d>		shapePts(maxVerts);	// tried this as well
std::vector<DPoint3d>		shapePts;
shapePts.reserve(maxVerts);
//mdlLinear_extract( (DPoint3d*)&shapePts, &maxVerts, elHandle.GetElementP(), elHandle.GetModelRef() );		// bombs here
mdlLinear_extract( (DPoint3d*)&shapePts[0], &maxVerts, elHandle.GetElementP(), elHandle.GetModelRef() );	// bombs here

Can a std::vector<DPoint3d> be passed into mdl functions looking "*Dpoint3d" ?

Thanks,

Bruce


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>