Пример #1
0
 FeatureCoordinates::FeatureCoordinates(const LWF::NormalVectorElement& nor){
   mpCamera_ = nullptr;
   trackWarping_ = false;
   resetCoordinates();
   nor_ = nor;
   valid_nor_ = true;
 }
Пример #2
0
 FeatureCoordinates::FeatureCoordinates(const cv::Point2f& pixel){
   mpCamera_ = nullptr;
   trackWarping_ = false;
   resetCoordinates();
   c_ = pixel;
   valid_c_ = true;
 }
Пример #3
0
/*
 * Values are considered as being specified per-vertex for now
 * To be corrected
 */
int TriangleMeshData::setNumVertices(unsigned int numVertices)
{
    int result = 1;

    if (numVertices == 0 && numberVertices > 0)
    {
        numberVertices = 0;

        delete [] vertices;
        delete [] values;

        return 1;
    }

    if (numVertices != this->numberVertices)
    {
        double* newVertices = NULL;
        double* newValues = NULL;

        try
        {
            newVertices = new double[3 * numVertices];
        }
        catch (const std::exception& e)
        {
            e.what();
            result = 0;
        }

        try
        {
            newValues = new double[numVertices];
        }
        catch (const std::exception& e)
        {
            e.what();
            result = 0;
        }

        if (result)
        {
            if (this->numberVertices > 0)
            {
                delete [] vertices;
                delete [] values;
            }

            vertices = newVertices;
            values = newValues;

            this->numberVertices =  numVertices;

            resetCoordinates();
        }
        else
        {
            /* Failed allocation, nothing is set */
            if (newVertices != NULL)
            {
                delete [] newVertices;
            }

            if (newValues != NULL)
            {
                delete [] newValues;
            }
        }

    }

    return result;
}
Пример #4
0
 FeatureCoordinates::FeatureCoordinates(){
   mpCamera_ = nullptr;
   trackWarping_ = false;
   resetCoordinates();
 }
Пример #5
0
 FeatureCoordinates::FeatureCoordinates(const Camera* mpCamera): mpCamera_(mpCamera){
   trackWarping_ = false;
   resetCoordinates();
 }