Changeset 1065 for cpp/frams


Ignore:
Timestamp:
01/27/21 12:20:00 (4 years ago)
Author:
Maciej Komosinski
Message:

More specific error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/similarity/simil-measure-base.cpp

    r1048 r1065  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    2626        models[1] = newModel(genos[1]);
    2727
     28        if (models[0] == NULL)
     29                logPrintf("SimilMeasureBase", "evaluateDistance", LOG_ERROR, "Unable to create a Model from genotype '%s'.", G0->getGenes().c_str());
     30        if (models[1] == NULL)
     31                logPrintf("SimilMeasureBase", "evaluateDistance", LOG_ERROR, "Unable to create a Model from genotype '%s'.", G1->getGenes().c_str());
    2832        if (models[0] == NULL || models[1] == NULL)
    29         {
    30                 logPrintf("SimilarityMeasure", "EvaluateDistance", LOG_ERROR, "Unable to create model from one of the genotypes.");
    3133                return -1;
    32         }
    33        
     34
    3435        double distance = getDistance();
    3536        SAFEDELETE(models[0]);
     
    6768Model SimilMeasureBase::sampleSurface(Model* M, double density)
    6869{
    69     Model resultModel;
    70     resultModel.open();
    71     GeometryUtils::addAnchorToModel(resultModel);
     70        Model resultModel;
     71        resultModel.open();
     72        GeometryUtils::addAnchorToModel(resultModel);
    7273
    73     MeshBuilder::ModelSurface iterator(density);
    74     iterator.initialize(M);
     74        MeshBuilder::ModelSurface iterator(density);
     75        iterator.initialize(M);
    7576
    76     Pt3D point;
    77     while (iterator.tryGetNext(point))
    78     {
    79         GeometryUtils::addPointToModel(point, resultModel);
    80     }
     77        Pt3D point;
     78        while (iterator.tryGetNext(point))
     79        {
     80                GeometryUtils::addPointToModel(point, resultModel);
     81        }
    8182
    82     resultModel.close();
    83     return resultModel;
     83        resultModel.close();
     84        return resultModel;
    8485}
Note: See TracChangeset for help on using the changeset viewer.