| 59 | #include "Gui/ViewerTab.h" |
| 60 | |
| 61 | NATRON_NAMESPACE_ENTER |
| 62 | |
| 63 | void |
| 64 | ProjectGuiSerialization::initialize(const ProjectGui* projectGui) |
| 65 | { |
| 66 | NodesList activeNodes; |
| 67 | |
| 68 | projectGui->getInternalProject()->getActiveNodesExpandGroups(&activeNodes); |
| 69 | |
| 70 | _serializedNodes.clear(); |
| 71 | for (NodesList::iterator it = activeNodes.begin(); it != activeNodes.end(); ++it) { |
| 72 | NodeGuiIPtr nodegui_i = (*it)->getNodeGui(); |
| 73 | if (!nodegui_i) { |
| 74 | continue; |
| 75 | } |
| 76 | NodeGuiPtr nodegui = std::dynamic_pointer_cast<NodeGui>(nodegui_i); |
| 77 | |
| 78 | if ( nodegui->isVisible() ) { |
| 79 | NodeCollectionPtr isInCollection = (*it)->getGroup(); |
| 80 | NodeGroup* isCollectionAGroup = dynamic_cast<NodeGroup*>( isInCollection.get() ); |
| 81 | if (!isCollectionAGroup) { |
| 82 | ///Nodes within a group will be serialized recursively in the node group serialization |
| 83 | NodeGuiSerialization state; |
| 84 | nodegui->serialize(&state); |
| 85 | _serializedNodes.push_back(state); |
| 86 | } |
| 87 | ViewerInstance* viewer = (*it)->isEffectViewer(); |
| 88 | if (viewer) { |
| 89 | ViewerTab* tab = projectGui->getGui()->getViewerTabForInstance(viewer); |
| 90 | assert(tab); |
| 91 | if (tab) { |
| 92 | ViewerGL* v = tab->getViewer(); |
| 93 | if (v) { |
| 94 | ViewerData viewerData; |
| 95 | double zoompar; |
| 96 | v->getProjection(&viewerData.zoomLeft, &viewerData.zoomBottom, &viewerData.zoomFactor, &zoompar); |
| 97 | viewerData.userRoI = v->getUserRegionOfInterest(); |
| 98 | viewerData.userRoIenabled = v->isUserRegionOfInterestEnabled(); |
| 99 | viewerData.isClippedToProject = tab->isClippedToProject(); |
| 100 | viewerData.autoContrastEnabled = tab->isAutoContrastEnabled(); |
| 101 | viewerData.gain = tab->getGain(); |
| 102 | viewerData.gamma = tab->getGamma(); |
| 103 | viewerData.colorSpace = tab->getColorSpace(); |
| 104 | viewerData.channels = tab->getChannelsString(); |
| 105 | viewerData.renderScaleActivated = tab->getRenderScaleActivated(); |
| 106 | viewerData.mipMapLevel = tab->getMipMapLevel(); |
| 107 | viewerData.zoomOrPanSinceLastFit = tab->getZoomOrPannedSinceLastFit(); |
| 108 | viewerData.wipeCompositingOp = (int)tab->getCompositingOperator(); |
| 109 | viewerData.leftToolbarVisible = tab->isLeftToolbarVisible(); |
| 110 | viewerData.rightToolbarVisible = tab->isRightToolbarVisible(); |
| 111 | viewerData.topToolbarVisible = tab->isTopToolbarVisible(); |
| 112 | viewerData.infobarVisible = tab->isInfobarVisible(); |
| 113 | viewerData.playerVisible = tab->isPlayerVisible(); |
| 114 | viewerData.timelineVisible = tab->isTimelineVisible(); |
| 115 | viewerData.checkerboardEnabled = tab->isCheckerboardEnabled(); |
| 116 | viewerData.isFullFrameProcessEnabled = tab->isFullFrameProcessingEnabled(); |
| 117 | viewerData.fps = tab->getDesiredFps(); |
| 118 | viewerData.fpsLocked = tab->isFPSLocked(); |
nothing calls this directly
no test coverage detected