Blender  V3.3
Controller.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 extern "C" {
8 #include <Python.h>
9 }
10 
11 #include <cfloat>
12 #include <fstream>
13 #include <string>
14 
15 #include "AppCanvas.h"
16 #include "AppConfig.h"
17 #include "AppView.h"
18 #include "Controller.h"
19 
20 #include "../image/Image.h"
21 
22 #include "../scene_graph/NodeDrawingStyle.h"
23 #include "../scene_graph/NodeShape.h"
24 #include "../scene_graph/NodeTransform.h"
25 #include "../scene_graph/NodeViewLayer.h"
26 #include "../scene_graph/ScenePrettyPrinter.h"
27 #include "../scene_graph/VertexRep.h"
28 
29 #include "../stroke/PSStrokeRenderer.h"
30 #include "../stroke/StrokeTesselator.h"
31 #include "../stroke/StyleModule.h"
32 #include "../stroke/TextStrokeRenderer.h"
33 
34 #include "../system/PythonInterpreter.h"
35 #include "../system/StringUtils.h"
36 
37 #include "../view_map/SteerableViewMap.h"
38 #include "../view_map/ViewMap.h"
39 #include "../view_map/ViewMapTesselator.h"
40 
41 #include "../winged_edge/Curvature.h"
42 #include "../winged_edge/WEdge.h"
43 #include "../winged_edge/WXEdgeBuilder.h"
44 #include "../winged_edge/WingedEdgeBuilder.h"
45 
46 #include "../blender_interface/BlenderFileLoader.h"
47 #include "../blender_interface/BlenderStrokeRenderer.h"
48 #include "../blender_interface/BlenderStyleModule.h"
49 
50 #include "BKE_global.h"
51 #include "BLI_path_util.h"
52 #include "BLI_utildefines.h"
53 
54 #include "DNA_freestyle_types.h"
55 
56 #include "FRS_freestyle.h"
57 
58 namespace Freestyle {
59 
61 {
62  const string sep(Config::DIR_SEP);
63 #if 0
64  const string filename = Config::Path::getInstance()->getHomeDir() + sep + Config::OPTIONS_DIR +
66  _current_dirs = new ConfigIO(filename, Config::APPLICATION_NAME + "CurrentDirs", true);
67 #endif
68 
69  _RootNode = new NodeGroup;
70  _RootNode->addRef();
71 
72 #if 0
73  _SilhouetteNode = NULL;
74  _ProjectedSilhouette = NULL;
75  _VisibleProjectedSilhouette = NULL;
76 
77  _DebugNode = new NodeGroup;
78  _DebugNode->addRef();
79 #endif
80 
81  _winged_edge = nullptr;
82 
83  _pView = nullptr;
84  _pRenderMonitor = nullptr;
85 
86  _edgeTesselationNature = (Nature::SILHOUETTE | Nature::BORDER | Nature::CREASE);
87 
88  _ProgressBar = new ProgressBar;
89  _SceneNumFaces = 0;
90 #if 0
91  _minEdgeSize = DBL_MAX;
92 #endif
93  _EPSILON = 1.0e-6;
94  _bboxDiag = 0;
95 
96  _ViewMap = nullptr;
97 
98  _Canvas = nullptr;
99 
101  //_VisibilityAlgo = ViewMapBuilder::ray_casting;
102 
103  _Canvas = new AppCanvas;
104 
105  _inter = new PythonInterpreter();
106  _EnableViewMapCache = false;
107  _EnableQI = true;
108  _EnableFaceSmoothness = false;
109  _ComputeRidges = true;
110  _ComputeSteerableViewMap = false;
111  _ComputeSuggestive = true;
112  _ComputeMaterialBoundaries = true;
113  _sphereRadius = 1.0;
114  _creaseAngle = 134.43;
115  prevSceneHash = -1.0;
116 
117  init_options();
118 }
119 
121 {
122  if (nullptr != _RootNode) {
123  int ref = _RootNode->destroy();
124  if (0 == ref) {
125  delete _RootNode;
126  }
127  }
128 
129 #if 0
130  if (NULL != _SilhouetteNode) {
131  int ref = _SilhouetteNode->destroy();
132  if (0 == ref) {
133  delete _SilhouetteNode;
134  }
135  }
136 
137  if (NULL != _DebugNode) {
138  int ref = _DebugNode->destroy();
139  if (0 == ref) {
140  delete _DebugNode;
141  }
142  }
143 #endif
144 
145  if (_winged_edge) {
146  delete _winged_edge;
147  _winged_edge = nullptr;
148  }
149 
150  if (nullptr != _ViewMap) {
151  delete _ViewMap;
152  _ViewMap = nullptr;
153  }
154 
155  if (nullptr != _Canvas) {
156  delete _Canvas;
157  _Canvas = nullptr;
158  }
159 
160  if (_inter) {
161  delete _inter;
162  _inter = nullptr;
163  }
164 
165  if (_ProgressBar) {
166  delete _ProgressBar;
167  _ProgressBar = nullptr;
168  }
169 
170  // delete _current_dirs;
171 }
172 
174 {
175  if (nullptr == iView) {
176  return;
177  }
178 
179  _pView = iView;
180  _Canvas->setViewer(_pView);
181 }
182 
184 {
185  _pRenderMonitor = iRenderMonitor;
186 }
187 
188 void Controller::setPassDiffuse(float *buf, int width, int height)
189 {
190  AppCanvas *app_canvas = dynamic_cast<AppCanvas *>(_Canvas);
191  BLI_assert(app_canvas != nullptr);
192  app_canvas->setPassDiffuse(buf, width, height);
193 }
194 
195 void Controller::setPassZ(float *buf, int width, int height)
196 {
197  AppCanvas *app_canvas = dynamic_cast<AppCanvas *>(_Canvas);
198  BLI_assert(app_canvas != nullptr);
199  app_canvas->setPassZ(buf, width, height);
200 }
201 
203 {
204  PythonInterpreter *py_inter = dynamic_cast<PythonInterpreter *>(_inter);
205  py_inter->setContext(C);
206 }
207 
209 {
210  if (!_EnableViewMapCache) {
211  return false;
212  }
213  if (sceneHashFunc.match()) {
214  return (nullptr != _ViewMap);
215  }
216  sceneHashFunc.store();
217  return false;
218 }
219 
221 {
222  BlenderFileLoader loader(re, view_layer, depsgraph);
223 
224  loader.setRenderMonitor(_pRenderMonitor);
225 
226  _Chrono.start();
227 
228  NodeGroup *blenderScene = loader.Load();
229 
230  if (blenderScene == nullptr) {
231  if (G.debug & G_DEBUG_FREESTYLE) {
232  cout << "Cannot load scene" << endl;
233  }
234  return 1;
235  }
236 
237  if (blenderScene->numberOfChildren() < 1) {
238  if (G.debug & G_DEBUG_FREESTYLE) {
239  cout << "Empty scene" << endl;
240  }
241  blenderScene->destroy();
242  delete blenderScene;
243  return 1;
244  }
245 
246  real duration = _Chrono.stop();
247  if (G.debug & G_DEBUG_FREESTYLE) {
248  cout << "Scene loaded" << endl;
249  printf("Mesh cleaning : %lf\n", duration);
250  printf("View map cache : %s\n", _EnableViewMapCache ? "enabled" : "disabled");
251  }
252  _SceneNumFaces += loader.numFacesRead();
253 
254 #if 0
255  if (loader.minEdgeSize() < _minEdgeSize) {
256  _minEdgeSize = loader.minEdgeSize();
257  }
258 #endif
259 
260 #if 0 // DEBUG
261  ScenePrettyPrinter spp;
262  blenderScene->accept(spp);
263 #endif
264 
265  _RootNode->AddChild(blenderScene);
266  _RootNode->UpdateBBox(); // FIXME: Correct that by making a Renderer to compute the bbox
267 
268  _pView->setModel(_RootNode);
269  //_pView->FitBBox();
270 
271  if (_pRenderMonitor->testBreak()) {
272  return 0;
273  }
274 
275  if (_EnableViewMapCache) {
276 
277  NodeCamera *cam;
278  if (g_freestyle.proj[3][3] != 0.0) {
279  cam = new NodeOrthographicCamera;
280  }
281  else {
282  cam = new NodePerspectiveCamera;
283  }
284  double proj[16];
285  for (int i = 0; i < 4; i++) {
286  for (int j = 0; j < 4; j++) {
287  proj[i * 4 + j] = g_freestyle.proj[i][j];
288  }
289  }
290  cam->setProjectionMatrix(proj);
291  _RootNode->AddChild(cam);
292  _RootNode->AddChild(new NodeViewLayer(*re->scene, *view_layer));
293 
294  sceneHashFunc.reset();
295  // blenderScene->accept(sceneHashFunc);
296  _RootNode->accept(sceneHashFunc);
297  if (G.debug & G_DEBUG_FREESTYLE) {
298  cout << "Scene hash : " << sceneHashFunc.toString() << endl;
299  }
300  if (hitViewMapCache()) {
301  ClearRootNode();
302  return 0;
303  }
304 
305  delete _ViewMap;
306  _ViewMap = nullptr;
307  }
308 
309  _Chrono.start();
310 
311  WXEdgeBuilder wx_builder;
312  wx_builder.setRenderMonitor(_pRenderMonitor);
313  blenderScene->accept(wx_builder);
314  _winged_edge = wx_builder.getWingedEdge();
315 
316  duration = _Chrono.stop();
317  if (G.debug & G_DEBUG_FREESTYLE) {
318  printf("WEdge building : %lf\n", duration);
319  }
320 
321 #if 0
322  _pView->setDebug(_DebugNode);
323 
324  // delete stuff
325  if (0 != ws_builder) {
326  delete ws_builder;
327  ws_builder = 0;
328  }
329 
330  soc QFileInfo qfi(iFileName);
331  soc string basename((const char *)qfi.fileName().toAscii().data());
332  char cleaned[FILE_MAX];
333  BLI_strncpy(cleaned, iFileName, FILE_MAX);
334  BLI_path_normalize(NULL, cleaned);
335  string basename = string(cleaned);
336 #endif
337 
338  _ListOfModels.emplace_back("Blender_models");
339 
340  _Scene3dBBox = _RootNode->bbox();
341 
342  _bboxDiag = (_RootNode->bbox().getMax() - _RootNode->bbox().getMin()).norm();
343  if (G.debug & G_DEBUG_FREESTYLE) {
344  cout << "Triangles nb : " << _SceneNumFaces << " imported, " << _winged_edge->getNumFaces()
345  << " retained" << endl;
346  cout << "Bounding Box : " << _bboxDiag << endl;
347  }
348 
349  ClearRootNode();
350 
351  _SceneNumFaces = _winged_edge->getNumFaces();
352  if (_SceneNumFaces == 0) {
354  return 1;
355  }
356 
357  return 0;
358 }
359 
361 {
363  _ListOfModels.clear();
364 
365  // We deallocate the memory:
366  ClearRootNode();
368  DeleteViewMap();
369 
370  // clears the canvas
371  _Canvas->Clear();
372 
373  // soc: reset passes
374  setPassDiffuse(nullptr, 0, 0);
375  setPassZ(nullptr, 0, 0);
376 }
377 
379 {
380  _pView->DetachModel();
381  if (nullptr != _RootNode) {
382  int ref = _RootNode->destroy();
383  if (0 == ref) {
384  _RootNode->addRef();
385  }
386  _RootNode->clearBBox();
387  }
388 }
389 
391 {
392  if (_winged_edge) {
393  delete _winged_edge;
394  _winged_edge = nullptr;
395  }
396 
397  // clears the grid
398  _Grid.clear();
399  _Scene3dBBox.clear();
400  _SceneNumFaces = 0;
401 #if 0
402  _minEdgeSize = DBL_MAX;
403 #endif
404 }
405 
406 void Controller::DeleteViewMap(bool freeCache)
407 {
408 #if 0
409  _pView->DetachSilhouette();
410  if (NULL != _SilhouetteNode) {
411  int ref = _SilhouetteNode->destroy();
412  if (0 == ref) {
413  delete _SilhouetteNode;
414  _SilhouetteNode = NULL;
415  }
416  }
417 
418  if (NULL != _ProjectedSilhouette) {
419  int ref = _ProjectedSilhouette->destroy();
420  if (0 == ref) {
421  delete _ProjectedSilhouette;
422  _ProjectedSilhouette = NULL;
423  }
424  }
425  if (NULL != _VisibleProjectedSilhouette) {
426  int ref = _VisibleProjectedSilhouette->destroy();
427  if (0 == ref) {
428  delete _VisibleProjectedSilhouette;
429  _VisibleProjectedSilhouette = NULL;
430  }
431  }
432 
433  _pView->DetachDebug();
434  if (NULL != _DebugNode) {
435  int ref = _DebugNode->destroy();
436  if (0 == ref) {
437  _DebugNode->addRef();
438  }
439  }
440 #endif
441 
442  if (nullptr != _ViewMap) {
443  if (freeCache || !_EnableViewMapCache) {
444  delete _ViewMap;
445  _ViewMap = nullptr;
446  prevSceneHash = -1.0;
447  }
448  else {
449  _ViewMap->Clean();
450  }
451  }
452 }
453 
455 {
456  if (_ListOfModels.empty()) {
457  return;
458  }
459 
460  DeleteViewMap(true);
461 
462  // retrieve the 3D viewpoint and transformations information
463  //----------------------------------------------------------
464  // Save the viewpoint context at the view level in order
465  // to be able to restore it later:
466 
467  // Restore the context of view:
468  // we need to perform all these operations while the
469  // 3D context is on.
471 
472 #if 0
473  if (G.debug & G_DEBUG_FREESTYLE) {
474  cout << "mv" << endl;
475  }
476 #endif
477  real mv[4][4];
478  for (int i = 0; i < 4; i++) {
479  for (int j = 0; j < 4; j++) {
480  mv[i][j] = g_freestyle.mv[i][j];
481 #if 0
482  if (G.debug & G_DEBUG_FREESTYLE) {
483  cout << mv[i][j] << " ";
484  }
485 #endif
486  }
487 #if 0
488  if (G.debug & G_DEBUG_FREESTYLE) {
489  cout << endl;
490  }
491 #endif
492  }
493 
494 #if 0
495  if (G.debug & G_DEBUG_FREESTYLE) {
496  cout << "\nproj" << endl;
497  }
498 #endif
499  real proj[4][4];
500  for (int i = 0; i < 4; i++) {
501  for (int j = 0; j < 4; j++) {
502  proj[i][j] = g_freestyle.proj[i][j];
503 #if 0
504  if (G.debug & G_DEBUG_FREESTYLE) {
505  cout << proj[i][j] << " ";
506  }
507 #endif
508  }
509 #if 0
510  if (G.debug & G_DEBUG_FREESTYLE) {
511  cout << endl;
512  }
513 #endif
514  }
515 
516  int viewport[4];
517  for (int i = 0; i < 4; i++) {
518  viewport[i] = g_freestyle.viewport[i];
519  }
520 
521 #if 0
522  if (G.debug & G_DEBUG_FREESTYLE) {
523  cout << "\nfocal:" << _pView->GetFocalLength() << endl << endl;
524  }
525 #endif
526 
527  // Flag the WXEdge structure for silhouette edge detection:
528  //----------------------------------------------------------
529 
530  if (G.debug & G_DEBUG_FREESTYLE) {
531  cout << "\n=== Detecting silhouette edges ===" << endl;
532  }
533  _Chrono.start();
534 
535  edgeDetector.setViewpoint(vp);
536  edgeDetector.enableOrthographicProjection(proj[3][3] != 0.0);
537  edgeDetector.enableRidgesAndValleysFlag(_ComputeRidges);
538  edgeDetector.enableSuggestiveContours(_ComputeSuggestive);
539  edgeDetector.enableMaterialBoundaries(_ComputeMaterialBoundaries);
540  edgeDetector.enableFaceSmoothness(_EnableFaceSmoothness);
541  edgeDetector.setCreaseAngle(_creaseAngle);
542  edgeDetector.setSphereRadius(_sphereRadius);
543  edgeDetector.setSuggestiveContourKrDerivativeEpsilon(_suggestiveContourKrDerivativeEpsilon);
544  edgeDetector.setRenderMonitor(_pRenderMonitor);
545  edgeDetector.processShapes(*_winged_edge);
546 
547  real duration = _Chrono.stop();
548  if (G.debug & G_DEBUG_FREESTYLE) {
549  printf("Feature lines : %lf\n", duration);
550  }
551 
552  if (_pRenderMonitor->testBreak()) {
553  return;
554  }
555 
556  // Builds the view map structure from the flagged WSEdge structure:
557  //----------------------------------------------------------
558  ViewMapBuilder vmBuilder;
559  vmBuilder.setEnableQI(_EnableQI);
560  vmBuilder.setViewpoint(vp);
561  vmBuilder.setTransform(
562  mv, proj, viewport, _pView->GetFocalLength(), _pView->GetAspect(), _pView->GetFovyRadian());
563  vmBuilder.setFrustum(_pView->znear(), _pView->zfar());
564  vmBuilder.setGrid(&_Grid);
565  vmBuilder.setRenderMonitor(_pRenderMonitor);
566 
567 #if 0
568  // Builds a tessellated form of the silhouette for display purpose:
569  //---------------------------------------------------------------
570  ViewMapTesselator3D sTesselator3d;
571  ViewMapTesselator2D sTesselator2d;
572  sTesselator2d.setNature(_edgeTesselationNature);
573  sTesselator3d.setNature(_edgeTesselationNature);
574 #endif
575 
576  if (G.debug & G_DEBUG_FREESTYLE) {
577  cout << "\n=== Building the view map ===" << endl;
578  }
579  _Chrono.start();
580  // Build View Map
581  _ViewMap = vmBuilder.BuildViewMap(
582  *_winged_edge, _VisibilityAlgo, _EPSILON, _Scene3dBBox, _SceneNumFaces);
583  _ViewMap->setScene3dBBox(_Scene3dBBox);
584 
585  if (G.debug & G_DEBUG_FREESTYLE) {
586  printf("ViewMap edge count : %i\n", _ViewMap->viewedges_size());
587  }
588 
589 #if 0
590  // Tesselate the 3D edges:
591  _SilhouetteNode = sTesselator3d.Tesselate(_ViewMap);
592  _SilhouetteNode->addRef();
593 
594  // Tesselate 2D edges
595  _ProjectedSilhouette = sTesselator2d.Tesselate(_ViewMap);
596  _ProjectedSilhouette->addRef();
597 #endif
598 
599  duration = _Chrono.stop();
600  if (G.debug & G_DEBUG_FREESTYLE) {
601  printf("ViewMap building : %lf\n", duration);
602  }
603 
604 #if 0
605  _pView->AddSilhouette(_SilhouetteNode);
606  _pView->AddSilhouette(_WRoot);
607  _pView->Add2DSilhouette(_ProjectedSilhouette);
608  _pView->Add2DVisibleSilhouette(_VisibleProjectedSilhouette);
609  _pView->AddDebug(_DebugNode);
610 #endif
611 
612  // Draw the steerable density map:
613  //--------------------------------
614  if (_ComputeSteerableViewMap) {
616  }
617  // Reset Style modules modification flags
618  resetModified(true);
619 
621 }
622 
624 {
625 #if 0 // soc
626  if ((!_Canvas) || (!_ViewMap)) {
627  return;
628  }
629 
630  // Build 4 nodes containing the edges in the 4 directions
632  unsigned i;
633  real c =
634  32.0f /
635  255.0f; // see SteerableViewMap::readSteerableViewMapPixel() for information about this 32.
636  for (i = 0; i < Canvas::NB_STEERABLE_VIEWMAP; ++i) {
637  ng[i] = new NodeGroup;
638  }
639  NodeShape *completeNS = new NodeShape;
640  completeNS->material().setDiffuse(c, c, c, 1);
641  ng[Canvas::NB_STEERABLE_VIEWMAP - 1]->AddChild(completeNS);
643  svm->Reset();
644 
646  LineRep *fRep;
647  NodeShape *ns;
648  for (ViewMap::fedges_container::iterator f = fedges.begin(), fend = fedges.end(); f != fend;
649  ++f) {
650  if ((*f)->viewedge()->qi() != 0) {
651  continue;
652  }
653  fRep = new LineRep((*f)->vertexA()->point2d(), (*f)->vertexB()->point2d());
654  completeNS->AddRep(fRep); // add to the complete map anyway
655  double *oweights = svm->AddFEdge(*f);
656  for (i = 0; i < (Canvas::NB_STEERABLE_VIEWMAP - 1); ++i) {
657  ns = new NodeShape;
658  double wc = oweights[i] * c;
659  if (oweights[i] == 0) {
660  continue;
661  }
662  ns->material().setDiffuse(wc, wc, wc, 1);
663  ns->AddRep(fRep);
664  ng[i]->AddChild(ns);
665  }
666  }
667 
669  //#ifdef WIN32
670  QGLBasicWidget offscreenBuffer(_pView, "SteerableViewMap", _pView->width(), _pView->height());
671  QPixmap pm;
672  QImage qimg;
673  for (i = 0; i < Canvas::NB_STEERABLE_VIEWMAP; ++i) {
674  offscreenBuffer.AddNode(ng[i]);
675 # if 0
676  img[i] = new GrayImage(_pView->width(), _pView->height());
677  offscreenBuffer.readPixels(0,0,_pView->width(), _pView->height(), img[i]->getArray());
678 # endif
679  pm = offscreenBuffer.renderPixmap(_pView->width(), _pView->height());
680 
681  if (pm.isNull()) {
682  if (G.debug & G_DEBUG_FREESTYLE) {
683  cout << "BuildViewMap Warning: couldn't render the steerable ViewMap" << endl;
684  }
685  }
686  //pm.save(QString("steerable") + QString::number(i) + QString(".bmp"), "BMP");
687  // FIXME!! Lost of time !
688  qimg = pm.toImage();
689  // FIXME !! again!
690  img[i] = new GrayImage(_pView->width(), _pView->height());
691  for (unsigned int y = 0; y < img[i]->height(); ++y) {
692  for (unsigned int x = 0; x < img[i]->width(); ++x) {
693  //img[i]->setPixel(x, y, (float)qGray(qimg.pixel(x, y)) / 255.0f);
694  img[i]->setPixel(x, y, (float)qGray(qimg.pixel(x, y)));
695  // float c = qGray(qimg.pixel(x, y));
696  //img[i]->setPixel(x, y, qGray(qimg.pixel(x, y)));
697  }
698  }
699  offscreenBuffer.DetachNode(ng[i]);
700  ng[i]->destroy();
701  delete ng[i];
702  // check
703 # if 0
704  qimg = QImage(_pView->width(), _pView->height(), 32);
705  for (unsigned int y = 0; y < img[i]->height(); ++y) {
706  for (unsigned int x = 0; x < img[i]->width(); ++x) {
707  float v = img[i]->pixel(x, y);
708  qimg.setPixel(x, y, qRgb(v, v, v));
709  }
710  }
711  qimg.save(QString("newsteerable") + QString::number(i) + QString(".bmp"), "BMP");
712 # endif
713  }
714 
715  svm->buildImagesPyramids(img, false, 0, 1.0f);
716 #endif
717 }
718 
720 {
722  if (!svm) {
723  cerr << "the Steerable ViewMap has not been computed yet" << endl;
724  return;
725  }
726  svm->saveSteerableViewMap();
727 }
728 
730 {
731  if (_VisibilityAlgo == ViewMapBuilder::ray_casting) {
732  _VisibilityAlgo = ViewMapBuilder::ray_casting_fast;
733  }
734  else if (_VisibilityAlgo == ViewMapBuilder::ray_casting_fast) {
735  _VisibilityAlgo = ViewMapBuilder::ray_casting_very_fast;
736  }
737  else {
738  _VisibilityAlgo = ViewMapBuilder::ray_casting;
739  }
740 }
741 
743 {
744  switch (algo) {
746  _VisibilityAlgo = ViewMapBuilder::ray_casting;
747  break;
748  case FREESTYLE_ALGO_FAST:
749  _VisibilityAlgo = ViewMapBuilder::ray_casting_fast;
750  break;
752  _VisibilityAlgo = ViewMapBuilder::ray_casting_very_fast;
753  break;
756  break;
759  break;
762  break;
765  break;
766  }
767 }
768 
770 {
771  switch (_VisibilityAlgo) {
773  return FREESTYLE_ALGO_REGULAR;
775  return FREESTYLE_ALGO_FAST;
786  }
787 
788  // ray_casting_adaptive_traditional is the most exact replacement
789  // for legacy code
791 }
792 
794 {
795  _EnableViewMapCache = iBool;
796 }
797 
799 {
800  return _EnableViewMapCache;
801 }
802 
804 {
805  _EnableQI = iBool;
806 }
807 
809 {
810  return _EnableQI;
811 }
812 
814 {
815  _EnableFaceSmoothness = iBool;
816 }
817 
819 {
820  return _EnableFaceSmoothness;
821 }
822 
824 {
825  _ComputeRidges = b;
826 }
827 
829 {
830  return _ComputeRidges;
831 }
832 
834 {
835  _ComputeSuggestive = b;
836 }
837 
839 {
840  return _ComputeSuggestive;
841 }
842 
844 {
845  _ComputeMaterialBoundaries = b;
846 }
847 
849 {
850  return _ComputeMaterialBoundaries;
851 }
852 
854 {
855  _ComputeSteerableViewMap = iBool;
856 }
857 
859 {
860  return _ComputeSteerableViewMap;
861 }
862 
864 {
865  if (_ViewMap == nullptr) {
866  return 0;
867  }
868 
869  if (G.debug & G_DEBUG_FREESTYLE) {
870  cout << "\n=== Stroke drawing ===" << endl;
871  }
872  _Chrono.start();
873  _Canvas->Draw();
874  real d = _Chrono.stop();
875  int strokeCount = _Canvas->getStrokeCount();
876  if (G.debug & G_DEBUG_FREESTYLE) {
877  cout << "Strokes generation : " << d << endl;
878  cout << "Stroke count : " << strokeCount << endl;
879  }
880  resetModified();
881  DeleteViewMap();
882  return strokeCount;
883 }
884 
886 {
887  _render_count = 0;
888 }
889 
891 {
892  int totmesh = 0;
893  _Chrono.start();
894  BlenderStrokeRenderer *blenderRenderer = new BlenderStrokeRenderer(re, ++_render_count);
895  if (render) {
896  _Canvas->Render(blenderRenderer);
897  totmesh = blenderRenderer->GenerateScene();
898  }
899  real d = _Chrono.stop();
900  if (G.debug & G_DEBUG_FREESTYLE) {
901  cout << "Temporary scene generation: " << d << endl;
902  }
903  _Chrono.start();
904  Render *freestyle_render = blenderRenderer->RenderScene(re, render);
905  d = _Chrono.stop();
906  if (G.debug & G_DEBUG_FREESTYLE) {
907  cout << "Stroke rendering : " << d << endl;
908 
910  uintptr_t peak_memory = MEM_get_peak_memory();
911 
912  float megs_used_memory = (mem_in_use) / (1024.0 * 1024.0);
913  float megs_peak_memory = (peak_memory) / (1024.0 * 1024.0);
914 
915  printf("%d objs, mem %.2fM (peak %.2fM)\n", totmesh, megs_used_memory, megs_peak_memory);
916  }
917  delete blenderRenderer;
918 
919  return freestyle_render;
920 }
921 
922 void Controller::InsertStyleModule(unsigned index, const char *iFileName)
923 {
924  if (!BLI_path_extension_check(iFileName, ".py")) {
925  cerr << "Error: Cannot load \"" << string(iFileName) << "\", unknown extension" << endl;
926  return;
927  }
928 
929  StyleModule *sm = new StyleModule(iFileName, _inter);
930  _Canvas->InsertStyleModule(index, sm);
931 }
932 
933 void Controller::InsertStyleModule(unsigned index, const char *iName, const char *iBuffer)
934 {
935  StyleModule *sm = new BufferedStyleModule(iBuffer, iName, _inter);
936  _Canvas->InsertStyleModule(index, sm);
937 }
938 
939 void Controller::InsertStyleModule(unsigned index, const char *iName, struct Text *iText)
940 {
941  StyleModule *sm = new BlenderStyleModule(iText, iName, _inter);
942  _Canvas->InsertStyleModule(index, sm);
943 }
944 
945 void Controller::AddStyleModule(const char * /*iFileName*/)
946 {
947  //_pStyleWindow->Add(iFileName);
948 }
949 
950 void Controller::RemoveStyleModule(unsigned index)
951 {
952  _Canvas->RemoveStyleModule(index);
953 }
954 
956 {
957  _Canvas->Clear();
958 }
959 
960 void Controller::ReloadStyleModule(unsigned index, const char *iFileName)
961 {
962  StyleModule *sm = new StyleModule(iFileName, _inter);
963  _Canvas->ReplaceStyleModule(index, sm);
964 }
965 
966 void Controller::SwapStyleModules(unsigned i1, unsigned i2)
967 {
969 }
970 
971 void Controller::toggleLayer(unsigned index, bool iDisplay)
972 {
973  _Canvas->setVisible(index, iDisplay);
974 }
975 
976 void Controller::setModified(unsigned index, bool iMod)
977 {
978  //_pStyleWindow->setModified(index, iMod);
979  _Canvas->setModified(index, iMod);
980  updateCausalStyleModules(index + 1);
981 }
982 
984 {
985  vector<unsigned> vec;
986  _Canvas->causalStyleModules(vec, index);
987  for (vector<unsigned>::const_iterator it = vec.begin(); it != vec.end(); it++) {
988  //_pStyleWindow->setModified(*it, true);
989  _Canvas->setModified(*it, true);
990  }
991 }
992 
994 {
995  //_pStyleWindow->resetModified(iMod);
996  _Canvas->resetModified(iMod);
997 }
998 
999 NodeGroup *Controller::BuildRep(vector<ViewEdge *>::iterator vedges_begin,
1000  vector<ViewEdge *>::iterator vedges_end)
1001 {
1002  ViewMapTesselator2D tesselator2D;
1003  FrsMaterial mat;
1004  mat.setDiffuse(1, 1, 0.3, 1);
1005  tesselator2D.setFrsMaterial(mat);
1006 
1007  return (tesselator2D.Tesselate(vedges_begin, vedges_end));
1008 }
1009 
1011 {
1012  _edgeTesselationNature ^= (iNature);
1013  ComputeViewMap();
1014 }
1015 
1016 void Controller::setModelsDir(const string & /*dir*/)
1017 {
1018  //_current_dirs->setValue("models/dir", dir);
1019 }
1020 
1022 {
1023  string dir = ".";
1024  //_current_dirs->getValue("models/dir", dir);
1025  return dir;
1026 }
1027 
1028 void Controller::setModulesDir(const string & /*dir*/)
1029 {
1030  //_current_dirs->setValue("modules/dir", dir);
1031 }
1032 
1034 {
1035  string dir = ".";
1036  //_current_dirs->getValue("modules/dir", dir);
1037  return dir;
1038 }
1039 
1041 {
1042  if (_inter) {
1043  _inter->reset();
1044  }
1045 }
1046 
1048 {
1050  if (!svm) {
1051  return;
1052  }
1053 
1054  unsigned int i, j;
1055  using densityCurve = vector<Vec3r>;
1056  vector<densityCurve> curves(svm->getNumberOfOrientations() + 1);
1057  vector<densityCurve> curvesDirection(svm->getNumberOfPyramidLevels());
1058 
1059  // collect the curves values
1060  unsigned nbCurves = svm->getNumberOfOrientations() + 1;
1061  unsigned nbPoints = svm->getNumberOfPyramidLevels();
1062  if (!nbPoints) {
1063  return;
1064  }
1065 
1066  // build the density/nbLevels curves for each orientation
1067  for (i = 0; i < nbCurves; ++i) {
1068  for (j = 0; j < nbPoints; ++j) {
1069  curves[i].push_back(Vec3r(j, svm->readSteerableViewMapPixel(i, j, x, y), 0));
1070  }
1071  }
1072  // build the density/nbOrientations curves for each level
1073  for (i = 0; i < nbPoints; ++i) {
1074  for (j = 0; j < nbCurves; ++j) {
1075  curvesDirection[i].push_back(Vec3r(j, svm->readSteerableViewMapPixel(j, i, x, y), 0));
1076  }
1077  }
1078 
1079  // display the curves
1080 #if 0
1081  for (i = 0; i < nbCurves; ++i) {
1082  _pDensityCurvesWindow->setOrientationCurve(
1083  i, Vec2d(0, 0), Vec2d(nbPoints, 1), curves[i], "scale", "density");
1084  }
1085  for (i = 1; i <= 8; ++i) {
1086  _pDensityCurvesWindow->setLevelCurve(
1087  i, Vec2d(0, 0), Vec2d(nbCurves, 1), curvesDirection[i], "orientation", "density");
1088  }
1089  _pDensityCurvesWindow->show();
1090 #endif
1091 }
1092 
1094 {
1095  // from AppOptionsWindow.cpp
1096  // Default init options
1097 
1099 
1100  // Directories
1103 
1104  // ViewMap Format
1106 
1107  // Visibility
1109 
1110  // soc: initialize canvas
1111  _Canvas->init();
1112 
1113  // soc: initialize passes
1114  setPassDiffuse(nullptr, 0, 0);
1115  setPassZ(nullptr, 0, 0);
1116 }
1117 
1118 } /* namespace Freestyle */
Configuration file.
@ G_DEBUG_FREESTYLE
Definition: BKE_global.h:181
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define FILE_MAX
void BLI_path_normalize(const char *relabase, char *path) ATTR_NONNULL(2)
Definition: path_util.c:131
bool BLI_path_extension_check(const char *str, const char *ext) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
Definition: path_util.c:1299
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
#define UNPACK3(a)
The spinal tap of the system.
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
@ FREESTYLE_ALGO_FAST
@ FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE
@ FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL
@ FREESTYLE_ALGO_VERYFAST
@ FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE
@ FREESTYLE_ALGO_REGULAR
@ FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL
struct FreestyleGlobals g_freestyle
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint i1
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
#define C
Definition: RandGen.cpp:25
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
Definition: btVector3.h:263
void setViewer(AppView *iViewer)
Definition: AppCanvas.cpp:41
void setPassZ(float *buf, int width, int height)
Definition: AppCanvas.h:66
void setPassDiffuse(float *buf, int width, int height)
Definition: AppCanvas.h:60
virtual void init()
Definition: AppCanvas.cpp:76
void AddDebug(NodeGroup *iDebug)
Definition: AppView.h:128
unsigned int height()
Definition: AppView.h:37
real GetAspect() const
Definition: AppView.h:186
void AddSilhouette(NodeGroup *iSilhouette)
Definition: AppView.h:103
void setDebug(NodeGroup *iDebug)
Definition: AppView.h:118
void Add2DSilhouette(NodeGroup *)
Definition: AppView.h:108
void setModel(NodeGroup *iModel)
Definition: AppView.h:76
real GetFovyRadian() const
Definition: AppView.h:196
void DetachDebug()
Definition: AppView.h:178
void Add2DVisibleSilhouette(NodeGroup *)
Definition: AppView.h:113
unsigned int width()
Definition: AppView.h:33
real GetFocalLength()
Definition: AppView.cpp:154
void DetachModel(Node *iModel)
Definition: AppView.h:133
void DetachSilhouette()
Definition: AppView.h:162
void setRenderMonitor(RenderMonitor *iRenderMonitor)
Render * RenderScene(Render *re, bool render)
void setModified(unsigned index, bool iMod)
Definition: Canvas.cpp:253
SteerableViewMap * getSteerableViewMap()
Definition: Canvas.h:163
virtual void Draw()
Definition: Canvas.cpp:86
void RemoveStyleModule(unsigned index)
Definition: Canvas.cpp:185
void InsertStyleModule(unsigned index, StyleModule *iStyleModule)
Definition: Canvas.cpp:172
void causalStyleModules(std::vector< unsigned > &vec, unsigned index=0)
Definition: Canvas.cpp:266
virtual void Render(const StrokeRenderer *iRenderer)
Definition: Canvas.cpp:277
void SwapStyleModules(unsigned i1, unsigned i2)
Definition: Canvas.cpp:219
void resetModified(bool iMod=false)
Definition: Canvas.cpp:258
void ReplaceStyleModule(unsigned index, StyleModule *iStyleModule)
Definition: Canvas.cpp:232
static const int NB_STEERABLE_VIEWMAP
Definition: Canvas.h:61
void setVisible(unsigned index, bool iVisible)
Definition: Canvas.cpp:248
int getStrokeCount() const
Definition: Canvas.h:199
const string & getPatternsPath() const
Definition: AppConfig.h:52
static Path * getInstance()
Definition: AppConfig.cpp:52
const string & getModelsPath() const
Definition: AppConfig.h:48
const string & getHomeDir() const
Definition: AppConfig.h:68
Render * RenderStrokes(Render *re, bool render)
Definition: Controller.cpp:890
string getModelsDir() const
void setComputeSuggestiveContoursFlag(bool b)
Definition: Controller.cpp:833
void setPassZ(float *buf, int width, int height)
Definition: Controller.cpp:195
bool getFaceSmoothness() const
Definition: Controller.cpp:818
void updateCausalStyleModules(unsigned index)
Definition: Controller.cpp:983
bool getComputeMaterialBoundariesFlag() const
Definition: Controller.cpp:848
bool getComputeSteerableViewMapFlag() const
Definition: Controller.cpp:858
void toggleLayer(unsigned index, bool iDisplay)
Definition: Controller.cpp:971
void setComputeMaterialBoundariesFlag(bool b)
Definition: Controller.cpp:843
void setVisibilityAlgo(int algo)
Definition: Controller.cpp:742
void AddStyleModule(const char *iFileName)
Definition: Controller.cpp:945
void setComputeRidgesAndValleysFlag(bool b)
Definition: Controller.cpp:823
void setFaceSmoothness(bool iBool)
Definition: Controller.cpp:813
void setPassDiffuse(float *buf, int width, int height)
Definition: Controller.cpp:188
void saveSteerableViewMapImages()
Definition: Controller.cpp:719
void toggleEdgeTesselationNature(Nature::EdgeNature iNature)
void SwapStyleModules(unsigned i1, unsigned i2)
Definition: Controller.cpp:966
void RemoveStyleModule(unsigned index)
Definition: Controller.cpp:950
void ReloadStyleModule(unsigned index, const char *iFileName)
Definition: Controller.cpp:960
bool getQuantitativeInvisibility() const
Definition: Controller.cpp:808
void setModulesDir(const string &dir)
void DeleteViewMap(bool freeCache=false)
Definition: Controller.cpp:406
int LoadMesh(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph)
Definition: Controller.cpp:220
bool getComputeSuggestiveContoursFlag() const
Definition: Controller.cpp:838
string getModulesDir() const
NodeGroup * BuildRep(vector< ViewEdge * >::iterator vedges_begin, vector< ViewEdge * >::iterator vedges_end)
Definition: Controller.cpp:999
void setViewMapCache(bool iBool)
Definition: Controller.cpp:793
void setQuantitativeInvisibility(bool iBool)
Definition: Controller.cpp:803
void setContext(bContext *C)
Definition: Controller.cpp:202
void setComputeSteerableViewMapFlag(bool iBool)
Definition: Controller.cpp:853
void setModified(unsigned index, bool iMod)
Definition: Controller.cpp:976
void InsertStyleModule(unsigned index, const char *iFileName)
Definition: Controller.cpp:922
bool getComputeRidgesAndValleysFlag() const
Definition: Controller.cpp:828
void setView(AppView *iView)
Definition: Controller.cpp:173
void resetModified(bool iMod=false)
Definition: Controller.cpp:993
void setRenderMonitor(RenderMonitor *iRenderMonitor)
Definition: Controller.cpp:183
bool getViewMapCache() const
Definition: Controller.cpp:798
void displayDensityCurves(int x, int y)
AppCanvas * _Canvas
Definition: Controller.h:163
void setModelsDir(const string &dir)
void enableMaterialBoundaries(bool b)
virtual void processShapes(WingedEdge &)
void enableSuggestiveContours(bool b)
void setSuggestiveContourKrDerivativeEpsilon(float dkr)
void setCreaseAngle(float angle)
void enableFaceSmoothness(bool b)
void enableOrthographicProjection(bool b)
void setViewpoint(const Vec3f &ivp)
void setRenderMonitor(RenderMonitor *iRenderMonitor)
void enableRidgesAndValleysFlag(bool b)
virtual void clear()
Definition: FastGrid.cpp:17
void setDiffuse(float r, float g, float b, float a)
Definition: FrsMaterial.h:374
float pixel(unsigned x, unsigned y) const
void setPixel(unsigned x, unsigned y, float v)
virtual void reset()=0
void setProjectionMatrix(double projection_matrix[16])
Definition: NodeCamera.cpp:56
virtual int numberOfChildren()
Definition: NodeGroup.h:58
virtual void AddChild(Node *iChild)
Definition: NodeGroup.cpp:14
virtual const BBox< Vec3r > & UpdateBBox()
Definition: NodeGroup.cpp:97
virtual int destroy()
Definition: NodeGroup.cpp:24
virtual void accept(SceneVisitor &v)
Definition: NodeGroup.cpp:54
virtual void AddRep(Rep *iRep)
Definition: NodeShape.h:39
virtual const BBox< Vec3r > & bbox() const
Definition: Node.h:53
virtual void clearBBox()
Definition: Node.h:86
float readSteerableViewMapPixel(unsigned iOrientation, int iLevel, int x, int y)
double * AddFEdge(FEdge *iFEdge)
unsigned int getNumberOfOrientations() const
void buildImagesPyramids(GrayImage **steerableBases, bool copy=false, unsigned iNbLevels=4, float iSigma=1.0f)
unsigned int getNumberOfPyramidLevels() const
void setTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocalLength, real, real)
void setGrid(Grid *iGrid)
void setEnableQI(bool iBool)
void setViewpoint(const Vec3r &ivp)
void setFrustum(real iZnear, real iZfar)
ViewMap * BuildViewMap(WingedEdge &we, visibility_algo iAlgo, real epsilon, const BBox< Vec3r > &bbox, unsigned int sceneNumFaces)
void setRenderMonitor(RenderMonitor *iRenderMonitor)
void setFrsMaterial(const FrsMaterial &iMaterial)
void setNature(Nature::EdgeNature iNature)
NodeGroup * Tesselate(ViewMap *iViewMap)
vector< FEdge * > fedges_container
Definition: ViewMap.h:52
virtual void Clean()
Definition: ViewMap.cpp:49
int viewedges_size()
Definition: ViewMap.h:137
void setScene3dBBox(const BBox< Vec3r > &bbox)
Definition: ViewMap.h:179
fedges_container & FEdges()
Definition: ViewMap.h:115
static void setCurrentId(const unsigned id)
Definition: WEdge.h:1101
void setRenderMonitor(RenderMonitor *iRenderMonitor)
unsigned getNumFaces()
Definition: WEdge.h:1327
static char * basename(char *string)
Definition: datatoc.c:17
const Depsgraph * depsgraph
size_t(* MEM_get_peak_memory)(void)
Definition: mallocn.c:48
size_t(* MEM_get_memory_in_use)(void)
Definition: mallocn.c:45
static size_t mem_in_use
#define G(x, y, z)
static const string DIR_SEP("/")
static const string OPTIONS_DIR("."+APPLICATION_NAME)
static const string OPTIONS_CURRENT_DIRS_FILE("current_dirs.xml")
static const string APPLICATION_NAME("APPNAME")
VecMat::Vec2< double > Vec2d
Definition: Geom.h:21
VecMat::Vec3< real > Vec3r
Definition: Geom.h:28
static const EdgeNature BORDER
Definition: Nature.h:38
unsigned short EdgeNature
Definition: Nature.h:32
static const EdgeNature CREASE
Definition: Nature.h:40
static const EdgeNature SILHOUETTE
Definition: Nature.h:36
inherits from class Rep
Definition: AppCanvas.cpp:18
static unsigned c
Definition: RandGen.cpp:83
static unsigned x[3]
Definition: RandGen.cpp:73
double real
Definition: Precision.h:12
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
_W64 unsigned int uintptr_t
Definition: stdint.h:119
float viewpoint[3]
Definition: FRS_freestyle.h:22
float proj[4][4]
Definition: FRS_freestyle.h:24
float mv[4][4]
Definition: FRS_freestyle.h:23
static void setPatternsPath(const string &path)
static void setBrushesPath(const string &path)
Scene * scene
Definition: render_types.h:81