//$Header: /home/ben/Mapper/include/RCS/through_constraint.h,v 6.3 2002/06/10 22:16:17 ben Exp $
#ifndef THROUGH_CONSTRAINT_H
#define THROUGH_CONSTRAINT_H
// Copyright Benedict Adamson 2002.
// This file is part of Mapper.
// Mapper is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// Mapper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Mapper; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "assoc.h"
#include "constraint.h"
class curve;
class through_constraint
:public constraint
{
public: //Constructors and destructors.
through_constraint(
const double u,
const double ox = 0.0,
const double oy = 0.0
);
virtual ~through_constraint(void);
public: //Attributes
double x;
double y;
virtual void energy(
const double tol,
const vector< vector2 > &p,
double &e, //output
vector< vector2 > &dedp //output
) const;
public: //Relationships
inline curve *constrained_curve(void);
inline const curve *constrained_curve(void) const;
public: //Messages
private: //State
curve *constrained_curve_;
friend void assoc(
through_constraint &tc,
curve &cu,
vector2 &p
);
friend void unassoc(
through_constraint &c
);
};
inline curve *through_constraint::constrained_curve(void)
{
return this->constrained_curve_;
}
inline const curve *through_constraint::constrained_curve(void) const
{
return this->constrained_curve_;
}
#endif