Select to view content in your preferred language

Writing MultiPatches

3192
0
05-18-2011 03:34 PM
ChrisScrimgeour
New Contributor
I encountered a problem when trying to use the MultiPatchShapeBuffer to write a multipatch geometry.

It seems that MultiPatchShapeBuffer.Setup(shapeType, numParts, numPoints) ignores the numParts and numPoints parameters, and creates a buffer with 0 parts and 0 points.

The following code snippet illustrates the issue:

   FileGDBAPI::MultiPatchShapeBuffer buffer;

   std::cout << "Buffer: " << (size_t)buffer.shapeBuffer << ", " << buffer.inUseLength << ", " << buffer.allocatedLength << std::endl;

   FileGDBAPI::ShapeType shapeType = FileGDBAPI::shapeMultiPatch;
   int numParts = 5;
   int numPoints = 15;

   std::cout << "shape type: " << shapeType << ", numParts: " << numParts << ", numPoints: " << numPoints << std::endl;

   fgdbError result = buffer.Setup(shapeType, numParts, numPoints);

   std::cout << "Result: " << result << std::endl;

   std::cout << "Buffer: " << (size_t)buffer.shapeBuffer << ", " << buffer.inUseLength << ", " << buffer.allocatedLength << std::endl;

   buffer.GetShapeType(shapeType);
   buffer.GetNumParts(numParts);
   buffer.GetNumPoints(numPoints);

   std::cout << "shape type: " << shapeType << ", numParts: " << numParts << ", numPoints: " << numPoints << std::endl;
0 Kudos
0 Replies