//=-------------------------------------------------------------------------=// // Model management module // // // // Copyright © 2021 The Gem-graph Project // // // // This file is part of gem-graph. // // // // This program is free software: you can redistribute it and/or modify // // it under the terms of the GNU Affero General Public License as // // published by the Free Software Foundation, either version 3 of the // // License, or (at your option) any later version. // // // // This program is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU Affero General Public License for more details. // // // // You should have received a copy of the GNU Affero General Public License // // along with this program. If not, see . // //=-------------------------------------------------------------------------=// #include "../include/base.h" #include "../include/arrows.h" static Model_t *loadedModels; void ModelPrepareSpace(Space_t *globalDrawingSpace, Model_t *model) { globalDrawingSpace->size = (model->space_xmax+1) * (model->space_ymax+1) * (model->space_zmax+1); globalDrawingSpace->xmax = model->space_xmax; globalDrawingSpace->ymax = model->space_ymax; globalDrawingSpace->zmax = model->space_zmax; globalDrawingSpace->space = (SpaceUnit_t*) calloc(globalDrawingSpace->size, sizeof(SpaceUnit_t)); for (int i = 0; i < globalDrawingSpace->size; i++) { globalDrawingSpace->space[i].nsite = model->siteNumber; globalDrawingSpace->space[i].sites = (Site_t*) calloc(model->siteNumber, sizeof(Site_t)); } } void ModelPrepareArrows(Space_t *globalDrawingSpace, ArrowArray_t *arrowArray, Model_t *model) { arrowArray->array = (Arrow_t*) calloc(6, sizeof(Arrow_t)); arrowArray->size = 6; // Creating some arrows globalDrawingSpace->space[3].sites[1].narrow = 1; arrowArray->array[0].siteId = 1; arrowArray->array[0].x = 3; globalDrawingSpace->space[4].sites[0].narrow = 1; arrowArray->array[1].siteId = 0; arrowArray->array[1].x = 4; }