Ignore:
Timestamp:
07/03/20 00:32:23 (4 years ago)
Author:
Maciej Komosinski
Message:
  • separate "0" and "0s" formats (for SHAPE_BALL_AND_STICK and SHAPE_SOLIDS, respectively)
  • converting to format list (Geno::F0_FORMAT_LIST = "0,0s")
  • (optional) declaring Model as SHAPE_BALL_AND_STICK or SHAPE_SOLIDS (or SHAPE_UNKNOWN)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/similarity/simil_model.cpp

    r877 r972  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2019  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    122122
    123123        // assign matching function
    124         int (ModelSimil::* pfMatchingFunction) () = NULL;
     124        int (ModelSimil:: * pfMatchingFunction) () = NULL;
    125125
    126126        pfMatchingFunction = &ModelSimil::MatchPartsGeometry;
     
    534534                return NULL;
    535535        }
    536         Model *m = new Model(*g);
     536        Model *m = new Model(*g, Model::SHAPE_UNKNOWN);
    537537        if (!m->isValid())
    538538        {
     
    20582058                        {
    20592059                                if (geo)
    2060                                         dist[i*bigger + j] += m_adFactors[3] * m_aPositions[1 - m_iSmaller][i].length();
     2060                                        dist[i * bigger + j] += m_adFactors[3] * m_aPositions[1 - m_iSmaller][i].length();
    20612061                                else
    2062                                         dist[i*bigger + j] = m_adFactors[1] * m_aDegrees[1 - m_iSmaller][i][DEGREE] + m_adFactors[2] * m_aDegrees[1 - m_iSmaller][i][NEURONS];
     2062                                        dist[i * bigger + j] = m_adFactors[1] * m_aDegrees[1 - m_iSmaller][i][DEGREE] + m_adFactors[2] * m_aDegrees[1 - m_iSmaller][i][NEURONS];
    20632063                        }
    20642064                        // compute distance between parts
     
    20662066                        {
    20672067                                if (geo)
    2068                                         dist[i*bigger + j] += m_adFactors[3] * m_aPositions[1 - m_iSmaller][i].distanceTo(m_aPositions[m_iSmaller][j]);
     2068                                        dist[i * bigger + j] += m_adFactors[3] * m_aPositions[1 - m_iSmaller][i].distanceTo(m_aPositions[m_iSmaller][j]);
    20692069                                else
    2070                                         dist[i*bigger + j] = m_adFactors[1] * abs(m_aDegrees[1 - m_iSmaller][i][DEGREE] - m_aDegrees[m_iSmaller][j][DEGREE])
     2070                                        dist[i * bigger + j] = m_adFactors[1] * abs(m_aDegrees[1 - m_iSmaller][i][DEGREE] - m_aDegrees[m_iSmaller][j][DEGREE])
    20712071                                        + m_adFactors[2] * abs(m_aDegrees[1 - m_iSmaller][i][NEURONS] - m_aDegrees[m_iSmaller][j][NEURONS]);
    20722072                        }
     
    21042104        int nBigger = m_Mod[1 - m_iSmaller]->getPartCount();
    21052105
    2106         double* partsDistances = new double[nBigger*nBigger]();
     2106        double* partsDistances = new double[nBigger * nBigger]();
    21072107        FillPartsDistances(partsDistances, nBigger, nSmaller, false);
    21082108        int *assignment = new int[nBigger]();
     
    21382138                        // - models (m_Mod) exist and are available
    21392139                        // - all properties are created and available (m_aDegrees and m_aPositions)
    2140                         double* tmpPartsDistances = new double[nBigger*nBigger]();
     2140                        double* tmpPartsDistances = new double[nBigger * nBigger]();
    21412141                        std::copy(partsDistances, partsDistances + nBigger * nBigger, tmpPartsDistances);
    21422142                        // recompute geometric properties according to the transformation iTransform
Note: See TracChangeset for help on using the changeset viewer.