Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Border.cpp

Go to the documentation of this file.
00001 // Border.cpp: implementation of the Border class.
00002 //
00004 
00005 #include "Border.h"
00006 #include "Simulator.h"
00007 
00009 // Construction/Destruction
00011 
00012 Border::Border(real x, real y, 
00013                real normalX, real normalY, std::string label) : 
00014     PhysicalObject(label)
00015 {
00016    r.x=x;
00017    r.y=y;
00018    assert(normalX!=0 || normalY!=0);
00019    normal.x=normalX;
00020    normal.y=normalY;
00021 
00022    //set up bounding box
00023    boxMin.x=-ThyrixParameters::infinity;
00024    boxMax.x=ThyrixParameters::infinity;
00025    boxMin.y=-ThyrixParameters::infinity;
00026    boxMax.y=ThyrixParameters::infinity;
00027    if(normalX==0){
00028       //border on x direction
00029       if(normalY>0){
00030          //bottom border
00031          boxMax.y=r.y;
00032       } else {
00033          //top border
00034          boxMin.y=r.y;
00035       }
00036    }
00037    if(normalY==0){
00038       //border on y direction
00039       if(normalX>0){
00040          //left border
00041          boxMax.x=r.x;
00042       } else {
00043          //right border
00044          boxMin.x=r.x;
00045       }
00046    }
00047 }
00048 
00049 Border::~Border(){
00050 }

Thyrix homepageUsers' guide

(C) Arxia 2004-2005