Example #1
0
//----------------------------------------------------------
void ofPath::moveTo(const ofPoint & p){
	if(mode==COMMANDS){
		addCommand(Command(Command::moveTo,p));
	}else{
		if(lastPolyline().size()>0) newSubPath();
		lastPolyline().addVertex(p);
	}
	flagShapeChanged();
}
Example #2
0
//----------------------------------------------------------
void ofPath::moveTo(const ofPoint & p){
	if(mode==PATHS){
		if(lastPath().size()>0) newSubPath();
		lastPath().addCommand(ofSubPath::Command(ofSubPath::Command::lineTo,p));
		hasChanged = true;
	}else{
		if(lastPolyline().size()>0) newSubPath();
		lastPolyline().addVertex(p);
		bNeedsTessellation = true;
	}
}
Example #3
0
//----------------------------------------------------------
void ofPath::lineTo(const ofPoint & p){
	if(mode==COMMANDS){
		addCommand(Command(Command::lineTo,p));
	}else{
		lastPolyline().lineTo(p);
	}
	flagShapeChanged();
}
Example #4
0
//----------------------------------------------------------
void ofPath::close(){
	if(mode==COMMANDS){
		addCommand(Command(Command::close));
	}else{
		lastPolyline().setClosed(true);
	}
	flagShapeChanged();
}
Example #5
0
//----------------------------------------------------------
void ofPath::arcNegative(const ofPoint & centre, float radiusX, float radiusY, float angleBegin, float angleEnd){
	if(mode==COMMANDS){
		addCommand(Command(Command::arcNegative,centre,radiusX,radiusY,angleBegin,angleEnd));
	}else{
		lastPolyline().arcNegative(centre,radiusX,radiusY,angleBegin,angleEnd,circleResolution);
	}
	flagShapeChanged();
}
Example #6
0
//----------------------------------------------------------
void ofPath::quadBezierTo(const ofPoint & cp1, const ofPoint & cp2, const ofPoint & p){
	if(mode==COMMANDS){
		addCommand(Command(Command::quadBezierTo,p,cp1,cp2));
	}else{
		lastPolyline().quadBezierTo(cp1,cp2,p,curveResolution);
	}
	flagShapeChanged();
}
Example #7
0
//----------------------------------------------------------
void ofPath::curveTo(const ofPoint & p){
	if(mode==COMMANDS){
		addCommand(Command(Command::curveTo,p));
	}else{
		lastPolyline().curveTo(p,curveResolution);
	}
	flagShapeChanged();
}
Example #8
0
//----------------------------------------------------------
void ofPath::bezierTo(const glm::vec3 & cp1, const glm::vec3 & cp2, const glm::vec3 & p){
	if(mode==COMMANDS){
		addCommand(Command(Command::bezierTo,p,cp1,cp2));
	}else{
		lastPolyline().bezierTo(cp1,cp2,p,curveResolution);
	}
	flagShapeChanged();
}
Example #9
0
//----------------------------------------------------------
void ofPath::arcNegative(const ofPoint & centre, float radiusX, float radiusY, float angleBegin, float angleEnd){
	if(mode==PATHS){
		lastPath().addCommand(ofSubPath::Command(ofSubPath::Command::arcNegative,centre,radiusX,radiusY,angleBegin,angleEnd));
		hasChanged = true;
	}else{
		lastPolyline().arcNegative(centre,radiusX,radiusY,angleBegin,angleEnd,arcResolution);
		bNeedsTessellation = true;
	}
}
Example #10
0
//----------------------------------------------------------
void ofPath::quadBezierTo(const ofPoint & cp1, const ofPoint & cp2, const ofPoint & p){
	if(mode==PATHS){
		lastPath().addCommand(ofSubPath::Command(ofSubPath::Command::quadBezierTo,p,cp1,cp2));
		hasChanged = true;
	}else{
		lastPolyline().quadBezierTo(cp1,cp2,p);
		bNeedsTessellation = true;
	}
}
Example #11
0
//----------------------------------------------------------
void ofPath::curveTo(const ofPoint & p){
	if(mode==PATHS){
		lastPath().addCommand(ofSubPath::Command(ofSubPath::Command::curveTo,p));
		hasChanged = true;
	}else{
		lastPolyline().curveTo(p);
		bNeedsTessellation = true;
	}
}
Example #12
0
//----------------------------------------------------------
void ofPath::close(){
	if(mode==PATHS){
		lastPath().close();
		hasChanged = true;
	}else{
		lastPolyline().setClosed(true);
		bNeedsTessellation = true;
	}
	//newPath();
}