-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
#include "homog2d.hpp" | ||
using namespace h2d; | ||
using namespace h2d::img; | ||
|
||
template<typename T1,typename T2> | ||
void | ||
drawPts( Image<SvgImage>& im, const T1& shape1, const T2& shape2 )//, Color col ) | ||
{ | ||
auto x = shape1.intersects(shape2); | ||
if( x() ) | ||
draw( im, x.get() ); //, DrawParams().setColor(col) ); | ||
} | ||
|
||
int main() | ||
{ | ||
Image<SvgImage> im(300,250); | ||
|
||
Line2d li( Point2d(30,50), Point2d(100,80) ); | ||
li.draw( im, DrawParams().setColor(0,0,250) ); | ||
|
||
FRect r( 40,30,200,180 ); | ||
auto r2 = Homogr(-5.*M_PI/180.) * r; | ||
r2.draw( im, DrawParams().setColor(200,0,0) ); | ||
|
||
Circle cir( 162, 141, 65 ); | ||
cir.draw( im, DrawParams().setColor(0,250,0) ); | ||
|
||
drawPts( im, li, cir ); | ||
drawPts( im, li, r2 ); | ||
drawPts( im, r2, cir ); | ||
|
||
std::cout << im; | ||
} |