I made a program that prints dots and lines in a Page. So far that's all i could come up with.
When i try to print the lines and the dots it just prints consecutive points,I want it to print the points & lines in the page's coordinates.
I have been stuck for a long time now. Please Help.
Point.h
Code:
#pragma once
#include <iostream>
using namespace std;
class Point
{
private:
int x;
int y;
public:
Point(void);
Point( int x, int y );
Point( const Point &xPoint );
~Point(void);
void setX( int x );
int getX() const;
void setY( int y );
int getY() const;
Point & operator = ( const Point &xPoint );
bool operator == ( const Point &xPoint ) const;
bool includes( int cord_X, int cord_Y ) const;
bool includes( const Point &xPoint ) const;
void draw() const;
};
#pragma once
#include "Point.h"
const int MAXPoint = 100;
class PointCollection
{
private:
Point pts[ MAXPoint ];
int quantity;
public:
PointCollection( void );
PointCollection( const PointCollection &xPointCollection );
~PointCollection( void );
// To know how many Points are
// ..in the collection
int size() const;
PointCollection operator = ( const PointCollection &xPointCollection );
PointCollection &operator + ( const Point &xPoint );
Point &operator[]( int index );
const Point &operator[]( int index ) const;
bool isFull() const;
bool isEmpty() const;
bool includes( const Point &xPoint ) const;
int indexOf( const Point &xPoint ) const;
};
#pragma once
#include "Linea.h"
const int MAX = 100;
class LineCollection
{
private:
Linea lc[ MAX ];
int quantity;
public:
LineCollection(void);
LineCollection( const LineCollection &xLineCollection );
~LineCollection(void);
// To know how many Lines are
// ..in the collection
int size() const;
LineCollection operator = ( const LineCollection &xLineCollection );
LineCollection &operator + ( const Linea &xLinea );
Linea &operator [] ( int index );
const Linea &operator[]( int index ) const;
bool isFull() const;
bool isEmpty() const;
bool includes( const Linea &xLinea ) const;
int indexOF( const Linea &xLinea ) const;
friend ostream &operator << ( ostream &output, const LineCollection &xLineCollection );
friend istream &operator >> ( istream &input, LineCollection &xLineCollection );
};
Cool. So what is the output page, is it an array of characters?
I would do it by restricting yourself to drawing
(a) horizontal lines
(b) vertical line
(c) dots
When you draw a horizontal line, use the "-" character, when a vertical line use a "|", and when a dot use a ".". Have a coordinate system based on characters.
Actually it will print dots it should be more like this:
Code:
...............
. . . .
. . .
. ....... .
...............
.
.
.
.
.
.
I made the calculations needed to do so:
Depending on the coordinates the line would be printed.
for example L( 1, 1 ) will print a Horizontal line of dots.
Did i make myself clear enough. I'm really having a hard time translating what i want.
Hello All,
I want to get ride of Excel/word and want some software to draw my server room racks/server and overall topology. Please share you opinion/experience. thanks inadvance (1 Reply)
Discussion started by: Vit0_Corleone
1 Replies
2. Post Here to Contact Site Administrators and Moderators
Dear Admins / Mods,
I have been trying my luck with Megabits Drawing few times ;) but I am not sure how it works! :confused:
http://i49.tinypic.com/2ake15f.jpg
I have few questions:-
Why this page for me is still showing 3 Lotto & 4 SuperForumLotto purchased even after the drawing... (22 Replies)
Hi all,
I'm currently learning xlib and I've encountered a bizarre mistake: function calls such as XDrawPoint, XDrawLine, etc., don't seem to work; a blank window with nothing in is appears. I believe this has something to do with the window manager I use, fluxbox.
After checking the code and... (0 Replies)
Hi,
Is it possible to draw circle, box and other basic shapes using shell scripts ?
If so can anyone please tell as how to do it.
Thanks in advance. (3 Replies)
Hi guys,
I'm trying to make my program to print out tables usings line-drawing character (alternate char. set) with Curses Library. However, it always prints out control characters (^@) instead of the correct ones.
code example:
mvwaddch(my_window, 23, 12, ACS_RTEE);
appreciate your help,... (5 Replies)