1 /*=========================================================================
4 Module: $RCSfile: marIsocontour.cpp,v $
6 Date: $Date: 2008/10/31 16:32:55 $
7 Version: $Revision: 1.1 $
9 Copyright: (c) 2002, 2003
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notice for more information.
16 =========================================================================*/
19 #include "marIsocontour.h"
21 // ----------------------------------------------------------------------------
22 marIsocontour::marIsocontour() {
26 // ----------------------------------------------------------------------------
27 marIsocontour::~marIsocontour() {
29 //TODO - SACAR A UTILS
30 for (int ind = 0; ind < listContour.size(); ind++)
32 marPoint* p = listContour[ind];
33 listContour[ind] = NULL;
41 // ----------------------------------------------------------------------------
42 marIsocontour::marIsocontour(double intmax) {
43 this->intmax = intmax;
46 // ----------------------------------------------------------------------------
47 void marIsocontour::getCG(double *x, double *y) {
51 for (int i = 0; i < listContour.size(); i++){
58 sumax /= listContour.size();
59 sumay /= listContour.size();
65 // ----------------------------------------------------------------------------
66 void marIsocontour::insertPoint(double x, double y) {
67 marPoint* p = new marPoint(x, y);
68 listContour.push_back(p);
71 // ----------------------------------------------------------------------------
72 void marIsocontour::getPoint(int i, double *x, double *y) {
73 marPoint* p = listContour[i];
79 // ----------------------------------------------------------------------------
80 void marIsocontour::setPoint(int i, double x, double y) {
81 marPoint *p = listContour[i];
85 // ----------------------------------------------------------------------------
86 int marIsocontour::getSize() {
87 return listContour.size();
90 // ----------------------------------------------------------------------------
91 double marIsocontour::getMaxIntensity() {
95 // ----------------------------------------------------------------------------
96 int marIsocontour::getType() {
100 // ----------------------------------------------------------------------------
101 void marIsocontour::setType(int type) {
105 // ----------------------------------------------------------------------------
106 int marIsocontour::getDir(int i) {
107 marPoint* p = listContour[i];
108 return p->getDirection();
111 // ----------------------------------------------------------------------------
112 void marIsocontour::setDir(int i, int direction) {
113 marPoint *p = listContour[i];
114 p->setDirection(direction);
117 // ----------------------------------------------------------------------------
118 void marIsocontour::setInside(int i, bool ins) {
119 marPoint *p = listContour[i];
123 // ----------------------------------------------------------------------------
124 bool marIsocontour::getInside(int i) {
125 marPoint* p = listContour[i];
126 return p->getInside();
129 // ----------------------------------------------------------------------------
130 void marIsocontour::setMaxIntensity(double intmax) {
131 this->intmax = intmax;
134 // ----------------------------------------------------------------------------
135 void marIsocontour::removeLastPoint() {
136 listContour.pop_back();