*/}}

modelling_main.c 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Part of LaGUI demonstration programs
  3. * Copyright (C) 2022-2023 Wu Yiming
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "la_5.h"
  19. extern LA MAIN;
  20. void DataPanel(laUiList *uil, laPropPack *This, laPropPack *DetachedProps, laColumn *UNUSED, int context){
  21. laColumn* c=laFirstColumn(uil);
  22. laShowItem(uil,c,0,"la.differences");
  23. laShowItem(uil,c,0,"tns.world");
  24. laShowItem(uil,c,0,"la");
  25. }
  26. int RegisterEverything(){
  27. laRegisterUiTemplate("panel_data", "Data", DataPanel, 0, 0,0, 0,0,20);
  28. tnsObject* s=tnsCreateRootObject("My Root",0);
  29. tnsObject* o=tnsCreateLight(s,"Sun",10,10,10,1,1);
  30. tnsVector3d target={0,0,0}, up={0,0,1};
  31. tnsLookAt(o,target,up);
  32. tnsObject* mo=tnsCreateMeshPlane(s,"Plane", 0,0,0, 1);
  33. //tnsMeshEnterEditMode(mo);
  34. //tnsMeshLeaveEditMode(mo);
  35. //tnsCreateMeshPlane(s,"Plane", 0,0,10, 10);
  36. s=tnsCreateRootObject("My Root 0", 0);
  37. mo=tnsCreateMeshPlane(s,"Plane", 0,0,0, 1);
  38. }
  39. int main(int argc, char *argv[]){
  40. laInitArguments ia={0};
  41. laSetCompleteInitArguments(&ia);
  42. laProcessInitArguments(argc,argv,&ia);
  43. laGetReadyWith(&ia);
  44. RegisterEverything();
  45. laRefreshUDFRegistries();
  46. // Use this to save and load preference when exit and during start up
  47. // laEnsureUserPreferences();
  48. laSaveProp("tns.world");
  49. laAddRootDBInst("tns");
  50. laWindow* w = laDesignWindow(-1,-1,800,600);
  51. laLayout* l = laDesignLayout(w, "Scene");
  52. laBlock* b = l->FirstBlock;
  53. laSplitBlockHorizon(b,0.7);
  54. laCreatePanel(b->B2, "panel_data");
  55. laCreatePanel(b->B2, "LAUI_animation_actions");
  56. laSplitBlockVertical(b->B1,0.6);
  57. laCreatePanel(b->B1->B1, "LAUI_scene");
  58. laCreatePanel(b->B1->B2, "LAUI_animation_action_channels");
  59. laStartWindow(w);
  60. laMainLoop();
  61. return 0;
  62. }