📄 c0_dimen.hpp
字号:
//////////////////////////////////////
// START of File: C0_DIMEN.HPP
//////////////////////////////////////
#ifndef C0_DIMEN_HPP
#define C0_DIMEN_HPP
//-------------------------------------------------------------------
// COPYRIGHT NOTICE: This code is protected by Copyright!
//
// Copyright (c) 1994 through 1997 by DPC Technology Corporation.
// All rights reserved.
//
// See files "cf_copyr.txt" and "cf_licen.txt" for details of
// copyright and license specifications, and contact information.
//-------------------------------------------------------------------
//------------------------------
// Master Header File Listing:
//------------------------------
//
// Usage: #include <cf_api/c0_dimen.hpp>
// Abstract "2D Dimension Unit" objects such as "2D-Points", and
// "2D-Rectangles". Mainly used as params to display output ops.
class CF_EXPORT cf_2DPoint
//----------------------------------------------------------------
// Abstracts an integer-X/Y-coordinate 2D-Point PARTICULARLY
// well-suited for holding display coordinates for other objects
//----------------------------------------------------------------
{
public:
cf_2DPoint(); // Default c-tor inits x = y = 0.
cf_2DPoint( const cf_2DPoint &cr_cf_2dpSource ); // Copy c-tor.
cf_2DPoint( int iX, int iY ); // Fully param'ed c-tor.
~cf_2DPoint();
cf_2DPoint& operator=( const cf_2DPoint &cr_cf_2dpUserVal );
// We can swap 2D-Points about freely using this = op...
cf_2DPoint& operator += ( cf_2DPoint &r_cf_2dpTarget );
// Important for Bresenham Line Drawing Algorithms
// (especially in "Chart Bitmap Wall" 3D Transforms).
cf_2DPoint yieldMin( cf_2DPoint cf_2dpToCompareWith );
// Returns a (new) 2D Point componsed from
// the Min X of both Xs and the Min Y of both Ys
// of BOTH points. Used in Polar-Type Charts.
cf_2DPoint yieldMax( cf_2DPoint cf_2dpToCompareWith );
// Same idea, but uses the Max of each X pair and Y
// Pair. Also used in Polar-Type Charts.
int& x();
int& y();
// Get the coordinate info content of the 2D Point
void setZero();
// We modify these method names from the base class
// to insure we are CLEARLY mapped away from the
// base framework...
private:
int iX_, iY_;
}; // End of cf_2DPoint Declaration.
class CF_EXPORT cf_2DRect
//----------------------------------------------------------------
// Abstracts an integer-X/Y-coordinate 2D-Recangle PARTICULARLY
// well-suited for holding display coordinates for other objects
//----------------------------------------------------------------
{
public:
cf_2DRect();
cf_2DRect( cf_2DPoint bpUL, cf_2DPoint bpLR );
// We're gonna DROP prefix notation & go for the in-line
// "UL" = "Upper Left" -- "LR" = "Lower Right"
cf_2DRect( int iLeft, int iTop, int iRight, int iBottom );
// iLeft = The upper left X-value,
// iTop = The upper left Y-value
// iRight = The lower right X-value
// iBottom = The lower right Y-value
~cf_2DRect();
cf_2DRect operator=( const cf_2DRect &cr_cf_2drUserVal );
// We can swap 2D-Rects about freely using this = op...
int height();
int width();
int& top();
int& left();
int& bottom();
int& right();
// The Chart Framework geometry-kernel needs a basic
// set of "get field reference" methods from this object.
private:
int iLeft_, iTop_; // X/Y-Coords for Left/Top-Corner.
int iRight_, iBottom_; // X/Y-Coords for Right/Bottom-Corner.
}; // End of cf_2DRect Declaration.
#endif
//////////////////////////////////////
// END of File: C0_DIMEN.HPP
//////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -