20191230 We do not want to show the below code: We try to use function-name: Position not BattleField, but we couldn't. Something, we showed, functuion name restricted, and cannot print curves well on the display. Printing parameter point and curve_point, calculation was well. --- .\vCurveCalculation.cpp Mon Dec 30 15:38:43 2019 1 :#include2 :#include 3 :#include // ADD: 20191230 4 : 5 :#include "array_counter.h" // ADD: 20191230 6 :#include "sender.h" // ADD: 20191230 7 :#include "Print.h" // ADD: 20191230 8 : 9 :#include "vPoint.h" 10 :#include "vLine.h" 11 :#include "vCalculation.h" 12 :#include "vCurveCalculation.h" 13 : 14 :vPoint* vCurveCalculation::BattleField (vPoint* p1, vPoint* p2, vPoint* p3, vPoint* p4, float t) { 15 : vCalculation* calc = nullptr; 16 : 17 : printf("vCurveCalculation::BattleField: |%p|%p|%p|%p|", p1, p2, p3, p4 ); 18 : // calculation, revisement 19 : float tt = t*t; 20 : float c=2.0f; 21 : 22 : // Linear 23 : vPoint* p5 = calc->scalize( p1, (1.0f - t) ); // anchor p1 24 : vPoint* p6 = calc->scalize ( p4, t ); // anchor p4 25 : 26 : vPoint* point = calc->add ( p5, p6 ); 27 : 28 : //consider, p2 and p3 which are controls points. 29 : // Curve 30 : vPoint* p7 = calc->scalize( p2, (1.0f - tt) ); // anchor p2 31 : vPoint* p8 = calc->scalize ( p3, tt ); // anchor p3 32 : vPoint* curve_point = calc->add ( p7, p8 ); 33 : 34 : // Linear + Curve: Blend 35 : vPoint* blend_001 = calc->add( curve_point, point ); 36 : vPoint* blend = calc->scalize( blend_001, 0.5f); 37 : 38 : level_error_msg = 2; 39 : // Calculated points printed. 40 : log_msg_003("p5="); 41 : p5->print(); 42 : log_msg_003("p7="); 43 : p7->print(); 44 : 45 : log_msg_003("curve_point="); 46 : curve_point->print(); 47 : log_msg_003("blend="); 48 : blend->print(); 49 : log_msg_003("blend_001="); 50 : blend_001->print(); 51 : log_msg_003("point="); 52 : point->print(); 53 : level_error_msg = 3; 54 : 55 : printf("vCurveCalculation::BattleField: |%p|\r\n", blend ); 56 :// exit(-1); 57 : return blend; 58 : 59 :// return curve_point; 60 :} 61 : 62 :// p1: Anchor 63 :// p2: setting controls 64 :// 65 :// p3: Anchor(next) 66 :// p4: setting controls 67 :// 68 :// vCurveCalculation 69 :// Position 70 :/* vPoint* vCurveCalculation::Position (vPoint* p1, vPoint* p2, vPoint p3, vPoint* p4, float t) { 71 : vCalculation* calc = nullptr; 72 : 73 : // calculation, revisement 74 : float tt = t*t; 75 : 76 : vPoint* p5 = calc->multiple ( p1, 1 - tt ); 77 : vPoint* p6 = calc->multiple ( p3, tt ); 78 : 79 : vPoint point calc->add ( p5, p6 ); 80 : 81 : //consider, p2 and p3 which is controls point. 82 : 83 : return point; 84 :}*/ 85 : --- AryButton 8 = 1 void wButtonController::drawButtons ( HDC hdc ): Ends WM_MESSG 004: 15 *(p_evt->uMsg):1992137768 uMsg:15 p_evt->uMsg: 2685472 &uMsg: 2686020 WM_PAINT 005: 15 *(p_evt->uMsg):1992137768 uMsg: 15 WM_PAINT 006: 15 *(p_evt->uMsg):1992137768 uMsg: 15 WM_MESSG 000: hWnd 656230: uMsg 256: wParam 13: lParam 1835009: canvas 4362640: btc 4362656: *(p_evt->uMsg) 256: WM_MESSG 003: 256 *(p_evt->uMsg):256 wButtonController::Process: 256 / 15<-WM_PAINT wParam 13 lParam 1835009 this->event->uMsg:2686208 *(this->event->uMsg) 56 wButtonController::WM_PAINT: this->event->main_mode = 0 default: void wButtonController::drawButtons ( HDC hdc ): Starts AryButton 0 = 0 AryButton 1 = 0 AryButton 2 = 0 AryButton 3 = 0 AryButton 4 = 0 AryButton 5 = 0 AryButton 6 = 0 AryButton 7 = 0 AryButton 8 = 1 void wButtonController::drawButtons ( HDC hdc ): Ends WM_MESSG 004: 256 *(p_evt->uMsg):256 uMsg:256 p_evt->uMsg: 2686208 &uMsg: 2686208 WM_MESSG 000: hWnd 656230: uMsg 258: wParam 13: lParam 1835009: canvas 4362640: btc 4362656: *(p_evt->uMsg) 258: WM_MESSG 003: 258 *(p_evt->uMsg):258 wButtonController::Process: 258 / 15<-WM_PAINT wParam 13 lParam 1835009 this->event->uMsg:2686208 *(this->event->uMsg) 58 Called: InvalidateRect( this->event->hWnd, NULL, TRUE) 8 getchar = 13 void wCanvasController::ProcessWmChar (): 8 WM_MESSG 004: 258 *(p_evt->uMsg):258 uMsg:258 p_evt->uMsg: 2686208 &uMsg: 2686208 WM_MESSG 000: hWnd 656230: uMsg 15: wParam 0: lParam 0: canvas 4362640: btc 4362656: *(p_evt->uMsg) 15: WM_PAINT 001: 15 *(p_evt->uMsg):15 uMsg: 15 WM_MESSG 000: hWnd 656230: uMsg 20: wParam 771820300: lParam 0: canvas 4362640: btc 4362656: *(p_evt->uMsg) 20: WM_MESSG 003: 20 *(p_evt->uMsg):20 wButtonController::Process: 20 / 15<-WM_PAINT wParam 771820300 lParam 0 this->event->uMsg:2685472 *(this->event->uMsg) 0 Called: InvalidateRect( this->event->hWnd, NULL, TRUE) 8 getchar = 771820300 void wCanvasController::ProcessWmChar (): 8 WM_MESSG 004: 20 *(p_evt->uMsg):20 uMsg:20 p_evt->uMsg: 2685472 &uMsg: 2685472 WM_PAINT 002: 15 *(p_evt->uMsg):0 uMsg: 15 WM_MESSG 003: 15 *(p_evt->uMsg):0 wButtonController::Process: 0 / 15<-WM_PAINT wParam 771820300 lParam 0 this->event->uMsg:2685472 *(this->event->uMsg)= wButtonController::WM_PAINT: this->event->main_mode = 8 default: void wButtonController::drawButtons ( HDC hdc ): Starts AryButton 0 = 0 AryButton 1 = 0 AryButton 2 = 0 AryButton 3 = 0 AryButton 4 = 0 AryButton 5 = 0 AryButton 6 = 0 AryButton 7 = 0 AryButton 8 = 1 void wButtonController::drawButtons ( HDC hdc ): Ends memorized_CurveLines=0 memorized_CurveLines=0 WM_MESSG 004: 15 *(p_evt->uMsg):1992137768 uMsg:15 p_evt->uMsg: 2685472 &uMsg: 2686020 WM_PAINT 005: 15 *(p_evt->uMsg):1992137768 uMsg: 15 WM_PAINT 006: 15 *(p_evt->uMsg):1992137768 uMsg: 15 WM_MESSG 000: hWnd 656230: uMsg 257: wParam 13: lParam -1071906815: canvas 4362640: btc 4362656: *(p_evt->uMsg) 257: WM_MESSG 003: 257 *(p_evt->uMsg):257 wButtonController::Process: 257 / 15<-WM_PAINT wParam 13 lParam -1071906815 this->event->uMsg:2686208 *(this->event->u g)=257 wButtonController::ProcessWmKeyup: Starts:initialize 8 starts curve_initialization() STARTS CurveLines->FirstCreation() ac: 1: ac normal 1.0: 1: ac scale absolute 0.0f: 1 1 C1 1 C2 ac: 2: ac normal 1.0: 2: ac scale absolute 0.0f: 2 2 C1 2 2 ac: 3: ac normal 1.0: 3: ac scale absolute 0.0f: 3 3 C1 3 C2 ac: 4: ac normal 1.0: 4: ac scale absolute 0.0f: 4 4 C1 C2 aPS[ 0 ]->Anchor: ENDS CurveLines->FirstCreation() STARTS CurveLines->PrintAnchors(); dsitance from 0 to 1: 171.464282 dsitance from 1 to 2: 206.397674 dsitance from 2 to 3: 206.397674 dsitance from 3 to 4: 202.484567 dsitance from 4 to 5: 201.246118 ENDS CurveLines->PrintAnchors(); CurveLines->print_lines_num= 0 STARTS CurveLines->PrintControls(); vPointLinear::PrintControls: STARTS. C1 C2 distance 79.999991 C1 C2 distance 80.000004 C1 C2 distance 80.000011 C1 C2 distance 80.000035 C1 C2 distance 79.999959 C1 C2 distance 80.000046 vPointLinear::PrintControls: END. ENDS CurveLines->PrintControls(); CurveLines->print_lines_num= 0 vPointLinear::generateControls(): STARTS put_line: this->print_lines_num=0 this->numPS=6 i: 0 vLine: 0042002D 00420030 vPointLinear::put_line STARTS. put_line: this->print_lines_num=0 put_line: this->print_lines_num=1 PointLinear::put_line ENDS. i: 1 vLine: 0042002D 00420030 vPointLinear::put_line STARTS. put_line: this->print_lines_num=1 put_line: this->print_lines_num=2 PointLinear::put_line ENDS. i: 2 vLine: 0042002D 00420030 vPointLinear::put_line STARTS. put_line: this->print_lines_num=2 put_line: this->print_lines_num=3 PointLinear::put_line ENDS. i: 3 vLine: 0042002D 00420030 vPointLinear::put_line STARTS. put_line: this->print_lines_num=3 put_line: this->print_lines_num=4 PointLinear::put_line ENDS. i: 4 vLine: 0042002D 00420030 vPointLinear::put_line STARTS. put_line: this->print_lines_num=4 put_line: this->print_lines_num=5 PointLinear::put_line ENDS. i: 5 vLine: 0042002D 00420030 vPointLinear::put_line STARTS. put_line: this->print_lines_num=5 put_line: this->print_lines_num=6 PointLinear::put_line ENDS. this->print_lines_num = 6 vPointLinear::generateControls(): ENDS CurveLines->print_lines_num= 6 void vPointLinear::CurveRevisement () STARTS int vPointLinear::CurveRevisement: i= 0/ 5 vCurveCalculation::BattleField: |037A7F60|037BCEA0|037BCBB8|037A7D08|p5=p( -110.000000, 0.000000, 100.000000) p7=p( -76.704559, 11.244169, 119.104500) curve_point=p( -76.704559, 11.244169, 119.104500) blend=p( -93.352280, 5.622085, 109.552246) blend_001=p( -186.704559, 11.244169, 219.104492) point=p( -110.000000, 0.000000, 100.000000) vCurveCalculation::BattleField: |037BD200| curve_p : |037BD200| i= 1/ 5 vCurveCalculation::BattleField: |037A7F60|037BCEA0|037BCBB8|037A7D08|p5=p( -88.000000, 0.000000, 80.000000) p7=p( -73.636375, 10.794402, 114.340317) curve_point=p( -73.484085, 12.331750, 120.952362) blend=p( -78.742043, 11.165874, 120.476181) blend_001=p( -157.484085, 22.331749, 240.952362) point=p( -84.000000, 10.000000, 120.000000) vCurveCalculation::BattleField: |037BE4E8| curve_p : |037BE4E8| i= 2/ 5 vCurveCalculation::BattleField: |037A7F60|037BCEA0|037BCBB8|037A7D08|p5=p( -66.000000, 0.000000, 60.000004) p7=p( -64.431831, 9.445102, 100.047775) curve_point=p( -63.822681, 15.594494, 126.495956) blend=p( -60.911339, 17.797247, 133.247986) blend_001=p( -121.822678, 35.594494, 266.495972) point=p( -58.000000, 20.000000, 140.000000) vCurveCalculation::BattleField: |037BE650| curve_p : |037BE650| i= 3/ 5 vCurveCalculation::BattleField: |037A7F60|037BCEA0|037BCBB8|037A7D08|p5=p( -43.999996, 0.000000, 39.999996) p7=p( -49.090916, 7.196268, 76.226875) curve_point=p( -47.720329, 21.032402, 135.735275) blend=p( -39.860161, 25.516201, 147.867645) blend_001=p( -79.720322, 51.032402, 295.735291) point=p( -31.999996, 30.000002, 160.000000) vCurveCalculation::BattleField: |037BE5C0| curve_p : |037BE5C0| i= 4/ 5 vCurveCalculation::BattleField: |037A7F60|037BCEA0|037BCBB8|037A7D08|p5=p( -21.999998, 0.000000, 19.999998) p7=p( -27.613638, 4.047900, 42.877613) curve_point=p( -25.177040, 28.645470, 148.670319) blend=p( -15.588519, 34.322735, 164.335159) blend_001=p( -31.177038, 68.645470, 328.670319) point=p( -5.999998, 40.000000, 180.000000) vCurveCalculation::BattleField: |037BE800| curve_p : |037BE800| ---