FaceGen 3 SDKs Reference
Loading...
Searching...
No Matches
Fg3SamGui.hpp
1//
2// Copyright (c) Singular Inversions Inc. 2014
3//
4// Authors: Andrew Beatty
5// Created: June 30, 2014
6//
7
8#ifndef FG3SAMVIEW_HPP
9#define FG3SAMVIEW_HPP
10
11#include "Fg3dDisplay.hpp"
12#include "Fg3Sam.hpp"
13#include "Fg3Controls.hpp"
14#include "FgGuiApi.hpp"
15
16namespace Fg {
17
18bool loadFgFile(String8 const & fname,Face3 & ret);
19
20// Output SSM base verts set to mesh 'allVerts':
21OPT<Ssm3> linkLoadSsm(
22 NPT<String8> pathBaseN, // Can be empty. Base name without the '.egm'
23 NPT<Mesh> meshN); // Can be empty if filename is. Provides base allverts.
24
25// SSM can have empty stats and empty base verts:
26OPT<Vec3Fs> linkIdentVerts(NPT<Ssm3> ssmN,NPT<Sam3Coord> coordN);
27OPT<ImgRgba8> linkXformDetail(NPT<Scm3> scmN,NPT<Bytes> detailN);
28OPT<ImgRgba8> linkApplyScmNoDetail(NPT<Scm3> scmN,NPT<Sam3Coord> coordN);
29
30typedef Svec<NPT<Ssm3> > Ssm3Ns;
31
32Sfun<void(bool,Gui3d::VertIdx,Vec3F)> makeInteractiveDeformation(
33 IPT<Sam3Coord> coordN,
34 Ssm3Ns const & ssmNs); // can be empty
35
36// Window with random and average buttons:
37GuiPtr guiCreateNew(
38 Sam3Controls const & ctrls, // A pointer to this object is retained for the life of the window
39 IPT<Sam3Coord> coordN,
40 IPT<Bytes> detailN,
41 String8 const & store);
42
43// Window with Demographics, Interactive, Shape, Color, Texture, Tween, Genetic tabs:
44GuiPtr sam3GuiModify(
45 Sam3Controls const & ctrls, // Keeps a reference to this so client must ensure lifetime
46 IPT<Sam3Coord> coordN,
47 IPT<Bytes> detailN,
48 IPT<double> texModStrength, // detail texture modulation strength
49 Sptr<Gui3d::Capture> const & capture, // Needed by 'tween' and 'genetic'
50 String8 const & store,
51 bool pro); // numerical edit boxes and shape/color split demographics sliders
52
54{
55 GuiPtr win;
56 std::function<void()> onUpdate;
57};
58// A window with Edit controls Undo and Redo.
59SamGuiUndo sam3GuiUndo(
60 IPT<Sam3Coord> coordN, // Must be initialized so we can push starting value onto undo buffer
61 IPT<Bytes> detailN,
62 String8 const & store);
63
64// A window with face coordinate basis controls:
65GuiPtr sam3GuiBasis(IPT<Sam3Coord> coordN);
66// A window with face load / save (to FG file) buttons:
67GuiPtr sam3GuiFileFace(IPT<Sam3Coord> coordN,IPT<Bytes> detailN,bool addPartsExprComment);
68Sfun<void(String8 const &)> cLoadFgFileFunc(IPT<Sam3Coord> const & coordN,IPT<Bytes> const & detailN);
69// Display a SAM along with a full set of controls, starting with the given face,
70// or if more than one, a selector tab to compare faces:
71void viewSam3(Face3 const & face,Sam3s const & sams);
72
73}
74
75#endif