CFuzzyMembershipFunction::CFuzzyMembershipFunction (long x1, long x2, long x3)
  : m_Tnorm(Min), m_Tconorm(Max)
{
  assert((x1 < x2) && (x2 < x3));

  InitTriangle(x1,x2,x3);

  m_LastIndex = 0;
  m_LastIterator = m_Verticies.begin();
}
CFuzzyMembershipFunction::CFuzzyMembershipFunction (const CFuzzyElement& v1, const CFuzzyElement& v2, const CFuzzyElement& v3)
  : m_Tnorm(Min), m_Tconorm(Max)
{
  assert((v1.GetValue() < v2.GetValue()) && (v2.GetValue() < v3.GetValue()));
  assert((v2.GetMembership() > v1.GetMembership()) && (v2.GetMembership() > v3.GetMembership()));

  InitTriangle(v1,v2,v3);

  m_LastIndex = 0;
  m_LastIterator = m_Verticies.begin();
}
Example #3
0
void Renderer::init()
{
	init_shaders();

	ortho = new Matrix4f();
	mx_translate = new Matrix4f();
	mx_scale = new Matrix4f();
	mx_rotate = new Matrix4f();
    
    init_rect();
    init_grid();
	InitPassGrid();
    init_line();
	init_tower();
	init_circle();
	init_ring();
	InitTriangle();
	InitPolygon();
	initHexGrid();
	
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
	glCullFace(GL_BACK);
}
CTriangleShapeView::CTriangleShapeView(sf::FloatRect const & frame)
	: CShapeView()
{
	InitTriangle();
	SetFrame(frame);
}
Example #5
0
 /**
  * \brief Constructs a triangle from a set of `Vec3` objects
  * 
  * @param vertex1 first vertex of the triangle
  * @param vertex2 second vertex of the triangle
  * @param vertex3 third vertex of the triangle
  */     
 Triangle(const Vec3& vertex1, const Vec3& vertex2, const Vec3& vertex3)
 {
     m_type = SHAPE_TRIANGLE;
     InitTriangle(vertex1, vertex2, vertex3);
 }
Example #6
0
 /**
  * \brief Constructs a triangle from a set of 3D coordinates
  * 
  * @param p1x x-coordinate of the first vertex of the triangle
  * @param p1y y-coordinate of the first vertex of the triangle
  * @param p1z z-coordinate of the first vertex of the triangle
  * @param p2x x-coordinate of the second vertex of the triangle
  * @param p2y y-coordinate of the second vertex of the triangle
  * @param p2z z-coordinate of the second vertex of the triangle
  * @param p3x x-coordinate of the third vertex of the triangle
  * @param p3y y-coordinate of the third vertex of the triangle
  * @param p3z z-coordinate of the third vertex of the triangle
  */    
 Triangle(float p1x, float p1y, float p1z, float p2x, float p2y, float p2z, float p3x, float p3y, float p3z)
 {
     m_type = SHAPE_TRIANGLE;
     InitTriangle(Vec3(p1x, p1y, p1z), Vec3(p2x, p2y, p2z), Vec3(p3x, p3y, p3z));
 }
Example #7
0
 /**
  * \brief Constructs a triangle from a set of 2D coordinates
  * 
  * @param p1x x-coordinate of the first vertex of the triangle
  * @param p1y y-coordinate of the first vertex of the triangle
  * @param p2x x-coordinate of the second vertex of the triangle
  * @param p2y y-coordinate of the second vertex of the triangle
  * @param p3x x-coordinate of the third vertex of the triangle
  * @param p3y y-coordinate of the third vertex of the triangle
  */
 Triangle(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y)
 {
     m_type = SHAPE_TRIANGLE;
     InitTriangle(Vec3(p1x, p1y), Vec3(p2x, p2y), Vec3(p3x, p3y));
 }