I don't know how , LNK2005 disappeared Linux OS.
But now I got a new problem,
when I'm using
Code: Select all
ccGenericPointCloud::VisibilityTableType *visibilityArray = cloud->getTheVisibilityArray();
it was error.
I click into getTheVisibilityArray() function, and in header file,
its return type is ccGenericPointCloud::VisibilityTableType not ccGenericPointCloud::VisibilityTableType *
but I serach in document-api online it return ccGenericPointCloud::VisibilityTableType *
why they are different?
Second, after I get the visibility array, visibilityArray is not a null object but its size is 0.
should I do any setting before it?
it's my code.
Code: Select all
ccGLCameraParameters camera;
m_glWindow_->getGLCameraParameters(camera);
const double half_w = camera.viewport[2] / 2.0;
const double half_h = camera.viewport[3] / 2.0;
ccGenericPointCloud::VisibilityTableType *visibilityArray = &c->getTheVisibilityArray();
assert(visibilityArray);
unsigned cloudSize = c->size();
qDebug() << "visibilityArray" << visibilityArray->size(); // it return 0
for (int i = 0; i < static_cast<int>(cloudSize); ++i)
{
qDebug() << "cloudSize"<< cloudSize;
if (visibilityArray->at(i) == POINT_VISIBLE) // it will runtime error because of its size.
{
const CCVector3* P3D = c->getPoint(i);
CCVector3d Q2D;
camera.project(*P3D, Q2D);
CCVector2 P2D( static_cast<PointCoordinateType>(Q2D.x-half_w),
static_cast<PointCoordinateType>(Q2D.y-half_h) );
bool pointInside = CCLib::ManualSegmentationTools::isPointInsidePoly(P2D, m_segmentationPoly_);
visibilityArray->at(i) = ( false != pointInside ? POINT_HIDDEN : POINT_VISIBLE );
}
}