Home | History | Annotate | Download | only in mosaic
      1 /*
      2  * Copyright (C) 2011 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 ///////////////////////////////////////////////////
     18 // CSite.h
     19 // $Id: CSite.h,v 1.3 2011/06/17 13:35:47 mbansal Exp $
     20 
     21 #ifndef TRIDEL_H
     22 #define TRIDEL_H
     23 
     24 #include "MosaicTypes.h"
     25 
     26 typedef struct
     27 {
     28     short first;
     29     short second;
     30 } SEdgeVector;
     31 
     32 typedef struct
     33 {
     34     double x;
     35     double y;
     36 } SVec2d;
     37 
     38 class CSite
     39 {
     40 private:
     41     MosaicFrame *mosaicFrame;
     42     SEdgeVector *neighbor;
     43     int numNeighbors;
     44     SVec2d voronoiCenter;
     45 
     46 public:
     47     CSite();
     48     ~CSite();
     49 
     50     inline MosaicFrame* getMb() { return mosaicFrame; }
     51     inline SEdgeVector* getNeighbor() { return neighbor; }
     52     inline int getNumNeighbors() { return numNeighbors; }
     53     inline SVec2d& getVCenter() { return voronoiCenter; }
     54     inline double X() { return voronoiCenter.x; }
     55     inline double Y() { return voronoiCenter.y; }
     56 
     57     inline void incrNumNeighbors() { numNeighbors++; }
     58     inline void setNumNeighbors(int num) { numNeighbors = num; }
     59     inline void setNeighbor(SEdgeVector *nb) { neighbor = nb; }
     60     inline void setMb(MosaicFrame *mb) { mosaicFrame = mb; }
     61 };
     62 
     63 #endif
     64