[an error occurred while processing this directive]
Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

HuginBase::MaskPolygon Class Reference

base class, which stores one polygon More...

#include <Mask.h>

List of all members.

Public Types

enum  MaskType { Mask_negative = 0, Mask_positive = 1 }
 enumeration with type of possible masks More...

Public Member Functions

 MaskPolygon ()
 constructor
bool isInside (const FDiff2D p) const
 checks if given point is inside of the stored polygon
int getWindingNumber (const FDiff2D p) const
 returns the winding number of the polygon around point p
int getTotalWindingNumber () const
 returns the total winding number of the polygon
MaskType getMaskType () const
 returns mask type
void setMaskType (const MaskType newType)
 sets mask type
VectorPolygon getMaskPolygon () const
 returns vector with coordinates of the polygon
void setMaskPolygon (const VectorPolygon newMask)
 set complete vector wit all corrdinates of the polygon
unsigned int getImgNr () const
 returns the associated image number, only used when loading a project, otherwise discarded
void setImgNr (const unsigned int newImgNr)
 sets the associated image number, only used when loading a project, otherwise discarded
void setInverted (const bool inverted)
 set mask to normal or inverted
bool isInverted () const
 returns if mask is inverted
void addPoint (const FDiff2D p)
 adds point at the end to the polygon
void insertPoint (const unsigned int index, const FDiff2D p)
 insert point at the position index into the polygon
void removePoint (const unsigned int index)
 removes point at the position index from the polygon
void movePointTo (const unsigned int index, const FDiff2D p)
 moves the point at position index to the new absolute position p
void movePointBy (const unsigned int index, const FDiff2D diff)
 relativ moves the point at position index by diff
void scale (const double factorx, const double factory)
 scales all polygon coordinates by factorx for x position and factory for y position
void scale (const double factor)
 scales x and y axis equally by factor
void transformPolygon (const PTools::Transform &trans)
 transforms the polygon coordinates by the given transformation
bool clipPolygon (const vigra::Rect2D rect)
 clips the polygon to the given rectangle
void rotate90 (bool clockwise, unsigned int maskWidth, unsigned int maskHeight)
 rotate the polygon by 90 degrees
void subSample (const double max_distance)
 subsamples the polygon, so that the longest distance between 2 points is max_distance
unsigned int FindPointNearPos (const FDiff2D p, const double tol)
 search a point which lies near the polygon line and return the index for inserting the new point
MaskPolygonoperator= (const MaskPolygon otherPoly)
 assign operator
const bool operator== (const MaskPolygon &otherPoly) const
 comparision operator
bool parsePolygonString (const std::string polygonStr)
 parses the x and y positions from the given string
void printPolygonLine (std::ostream &o, const unsigned int newImgNr) const
 writes the complete k line which describes the mask to the stream, using the given newImgNr for the i parameter


Detailed Description

base class, which stores one polygon


Member Enumeration Documentation

enum HuginBase::MaskPolygon::MaskType
 

enumeration with type of possible masks

Enumeration values:
Mask_negative 
Mask_positive 


Constructor & Destructor Documentation

HuginBase::MaskPolygon::MaskPolygon  )  [inline]
 

constructor


Member Function Documentation

void HuginBase::MaskPolygon::addPoint const FDiff2D  p  ) 
 

adds point at the end to the polygon

bool HuginBase::MaskPolygon::clipPolygon const vigra::Rect2D  rect  ) 
 

clips the polygon to the given rectangle

unsigned int HuginBase::MaskPolygon::FindPointNearPos const FDiff2D  p,
const double  tol
 

search a point which lies near the polygon line and return the index for inserting the new point

unsigned int HuginBase::MaskPolygon::getImgNr  )  const [inline]
 

returns the associated image number, only used when loading a project, otherwise discarded

VectorPolygon HuginBase::MaskPolygon::getMaskPolygon  )  const [inline]
 

returns vector with coordinates of the polygon

MaskType HuginBase::MaskPolygon::getMaskType  )  const [inline]
 

returns mask type

int HuginBase::MaskPolygon::getTotalWindingNumber  )  const
 

returns the total winding number of the polygon

int HuginBase::MaskPolygon::getWindingNumber const FDiff2D  p  )  const
 

returns the winding number of the polygon around point p

void HuginBase::MaskPolygon::insertPoint const unsigned int  index,
const FDiff2D  p
 

insert point at the position index into the polygon

bool HuginBase::MaskPolygon::isInside const FDiff2D  p  )  const
 

checks if given point is inside of the stored polygon

bool HuginBase::MaskPolygon::isInverted  )  const [inline]
 

returns if mask is inverted

void HuginBase::MaskPolygon::movePointBy const unsigned int  index,
const FDiff2D  diff
 

relativ moves the point at position index by diff

void HuginBase::MaskPolygon::movePointTo const unsigned int  index,
const FDiff2D  p
 

moves the point at position index to the new absolute position p

MaskPolygon & HuginBase::MaskPolygon::operator= const MaskPolygon  otherPoly  ) 
 

assign operator

const bool HuginBase::MaskPolygon::operator== const MaskPolygon otherPoly  )  const
 

comparision operator

bool HuginBase::MaskPolygon::parsePolygonString const std::string  polygonStr  ) 
 

parses the x and y positions from the given string

void HuginBase::MaskPolygon::printPolygonLine std::ostream &  o,
const unsigned int  newImgNr
const
 

writes the complete k line which describes the mask to the stream, using the given newImgNr for the i parameter

void HuginBase::MaskPolygon::removePoint const unsigned int  index  ) 
 

removes point at the position index from the polygon

void HuginBase::MaskPolygon::rotate90 bool  clockwise,
unsigned int  maskWidth,
unsigned int  maskHeight
 

rotate the polygon by 90 degrees

void HuginBase::MaskPolygon::scale const double  factor  )  [inline]
 

scales x and y axis equally by factor

void HuginBase::MaskPolygon::scale const double  factorx,
const double  factory
 

scales all polygon coordinates by factorx for x position and factory for y position

void HuginBase::MaskPolygon::setImgNr const unsigned int  newImgNr  )  [inline]
 

sets the associated image number, only used when loading a project, otherwise discarded

void HuginBase::MaskPolygon::setInverted const bool  inverted  )  [inline]
 

set mask to normal or inverted

void HuginBase::MaskPolygon::setMaskPolygon const VectorPolygon  newMask  )  [inline]
 

set complete vector wit all corrdinates of the polygon

void HuginBase::MaskPolygon::setMaskType const MaskType  newType  )  [inline]
 

sets mask type

void HuginBase::MaskPolygon::subSample const double  max_distance  ) 
 

subsamples the polygon, so that the longest distance between 2 points is max_distance

void HuginBase::MaskPolygon::transformPolygon const PTools::Transform trans  ) 
 

transforms the polygon coordinates by the given transformation


The documentation for this class was generated from the following files:

Generated on Mon Sep 20 01:01:36 2010 for Hugintrunk by doxygen 1.3.9.1