Software Solution for Engineers and Scientist Episode 10

Tham khảo tài liệu 'software solution for engineers and scientist episode 10', kỹ thuật - công nghệ, cơ khí - chế tạo máy phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 784 Chapter 28 the abstract class ConicSection which is also a subclass of GeometricalFigure. Observe that the interface which is the Draw method is defined in the abstract classes GeometricalFigure and ConicSection and implemented in the concrete classes. We have used the C convention of equating the function to zero to indicate that the methods in the abstract classes are pure virtual functions and that no implementation is provided. Also note that virtual functions in the abstract and concrete classes are in italics. GeometricalFigure Figure Classification ofa Graphics Toolkit Since the concrete classes can be instantiated we can create objects of Line Rectangle Circle Ellipse and Parabola. There can clearly be no object of the abstract classes ConicSection or GeometricalFigure since there can be no possible instantiation of these concepts. For these reasons abstract classes have no attributes. We can now proceed to draw on the video display using objects. For example The Object-Oriented Approach 785 Object Attributes Line_A Rectangle_A Rectangle_B Circle_A x_start 10 y_start 5 x_end 40 y_end 20 thickness x_top_left 5 y_top_left 20 x_bottom_right 25 y_bottom_right 30 line_thickness x_top_left 30 y_top_left 5 x_bottom_right 45 y_bottom_right 10 line_thickness x_coordinate 40 y_coordinate 30 radius 5 line_thickness 20 Figure represents these objects on the video display. Note that each object is identified by its name and preserved by its attributes. Also that there are two objects of the class Rectangle one is designated as Rectangle_A and the other one as Rect-angle_B. The fact that there are no objects of the class Ellipse or Parabola means only that these classes have not been instantiated. 10 20 30 40 Figure Objects Displayed Using the Graphics Toolkit 786 Chapter 28 In Figure we notice that there is a type of conic curve the hyperbola that is not defined in the toolkit. The class structure in the object-oriented paradigm

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
41    422    3    13-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.