Commit 5fce10fa authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Merge branch '34-fix-batch-services' into 'master'

Resolve "Fix batch services"

Closes #34

See merge request grp-fidentis/analyst-webapp!64
parents 8f18c578 fbec82bb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -240,7 +240,7 @@ public class BatchRegistrationServiceImpl extends BatchBaseService implements Ba
        File tempFile = File.createTempFile(this.getClass().getSimpleName(), ".obj");
        File tempFile = File.createTempFile(this.getClass().getSimpleName(), ".obj");
        tempFile.deleteOnExit();
        tempFile.deleteOnExit();


        HumanFace newAvgFace = HumanFaceFactory.create(avgMesh, tempFile.getCanonicalPath(), -1L, true);
        HumanFace newAvgFace = HumanFaceFactory.create("Average face", avgMesh, true);
        try {
        try {
            MeshIO.exportMeshModel(newAvgFace.getMeshModel(), tempFile);
            MeshIO.exportMeshModel(newAvgFace.getMeshModel(), tempFile);
        } catch (IOException ex) {
        } catch (IOException ex) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -107,7 +107,7 @@ public class HumanFaceServiceImpl implements HumanFaceService {
                featurePointsStream.flush();
                featurePointsStream.flush();
            }
            }


            face = HumanFaceFactory.create(-1L, geometryFile);
            face = HumanFaceFactory.create(geometryFile);
        } finally {
        } finally {
            Files.delete(geometryFile.toPath());
            Files.delete(geometryFile.toPath());
            if (featurePointsFile != null) {
            if (featurePointsFile != null) {
+43 −67
Original line number Original line Diff line number Diff line
@@ -65,14 +65,14 @@ const SymmetryTabPanel: FC<Props> = ({ taskType }) => {
	} = useContext(AnalyticalTaskContext);
	} = useContext(AnalyticalTaskContext);
	const [symmetryDto, setSymmetryDto] = useState<SymmetryTaskDto>({
	const [symmetryDto, setSymmetryDto] = useState<SymmetryTaskDto>({
		taskId: task?.id ?? -1,
		taskId: task?.id ?? -1,
		symmetryMethod: SymmetryMethod.FastMeshSurface,
		symmetryMethod: SymmetryMethod.RobustMeshSurface,
		candidateSearchSampling: {
		candidateSearchSampling: {
			samplingStrategy: PointSamplingStrategy.UniformSpaceSampling,
			samplingStrategy: PointSamplingStrategy.UniformSpaceSampling,
			samplingStrength: 200
			samplingStrength: 200
		},
		},
		candidatePruningSampling: {
		candidatePruningSampling: {
			samplingStrategy: PointSamplingStrategy.UniformSpaceSampling,
			samplingStrategy: PointSamplingStrategy.UniformSpaceSampling,
			samplingStrength: 200
			samplingStrength: 1000
		}
		}
	});
	});
	const facesRef = useRef<HumanFace[]>();
	const facesRef = useRef<HumanFace[]>();
@@ -216,9 +216,6 @@ const SymmetryTabPanel: FC<Props> = ({ taskType }) => {
							value={symmetryDto.symmetryMethod}
							value={symmetryDto.symmetryMethod}
							onChange={handleSymmetryMethodChange}
							onChange={handleSymmetryMethodChange}
						>
						>
							<MenuItem value={SymmetryMethod.FastMeshSurface}>
								Mesh surface (fast)
							</MenuItem>
							<MenuItem value={SymmetryMethod.RobustMeshSurface}>
							<MenuItem value={SymmetryMethod.RobustMeshSurface}>
								Mesh surface (robust)
								Mesh surface (robust)
							</MenuItem>
							</MenuItem>
@@ -330,12 +327,7 @@ const SymmetryTabPanel: FC<Props> = ({ taskType }) => {
												handleSamplingStrengthChange('search', value as number)
												handleSamplingStrengthChange('search', value as number)
											}
											}
											min={10}
											min={10}
											max={
											max={500}
												symmetryDto.symmetryMethod ===
												SymmetryMethod.RobustMeshVertices
													? 1000
													: 500
											}
											sx={{ maxWidth: 250 }}
											sx={{ maxWidth: 250 }}
										/>
										/>
										<span>
										<span>
@@ -356,11 +348,7 @@ const SymmetryTabPanel: FC<Props> = ({ taskType }) => {
												inputProps={{
												inputProps={{
													step: 1,
													step: 1,
													min: 10,
													min: 10,
													max:
													max: 500,
														symmetryDto.symmetryMethod ===
														SymmetryMethod.RobustMeshVertices
															? 1000
															: 500,
													type: 'number'
													type: 'number'
												}}
												}}
											/>
											/>
@@ -368,8 +356,6 @@ const SymmetryTabPanel: FC<Props> = ({ taskType }) => {
									</>
									</>
								</LabeledTextField>
								</LabeledTextField>


								{symmetryDto.symmetryMethod !==
									SymmetryMethod.FastMeshSurface && (
								<LabeledTextField
								<LabeledTextField
									text="Strength for pruning candidates:"
									text="Strength for pruning candidates:"
									labelMinWidth={270}
									labelMinWidth={270}
@@ -389,12 +375,7 @@ const SymmetryTabPanel: FC<Props> = ({ taskType }) => {
												)
												)
											}
											}
											min={10}
											min={10}
												max={
											max={2000}
													symmetryDto.symmetryMethod ===
													SymmetryMethod.RobustMeshSurface
														? 500
														: 5000
												}
											sx={{ maxWidth: 250 }}
											sx={{ maxWidth: 250 }}
										/>
										/>
										<span>
										<span>
@@ -416,18 +397,13 @@ const SymmetryTabPanel: FC<Props> = ({ taskType }) => {
												inputProps={{
												inputProps={{
													step: 1,
													step: 1,
													min: 10,
													min: 10,
														max:
													max: 2000,
															symmetryDto.symmetryMethod ===
															SymmetryMethod.RobustMeshVertices
																? 5000
																: 500,
													type: 'number'
													type: 'number'
												}}
												}}
											/>
											/>
										</span>
										</span>
									</>
									</>
								</LabeledTextField>
								</LabeledTextField>
								)}
							</Stack>
							</Stack>
						</Box>
						</Box>
					)}
					)}
+0 −1
Original line number Original line Diff line number Diff line
@@ -103,7 +103,6 @@ export enum ShowSpheres {
}
}


export enum SymmetryMethod {
export enum SymmetryMethod {
	FastMeshSurface = 'FAST_MESH_SURFACE',
	RobustMeshSurface = 'ROBUST_MESH_SURFACE',
	RobustMeshSurface = 'ROBUST_MESH_SURFACE',
	RobustMeshVertices = 'ROBUST_MESH_VERTICES',
	RobustMeshVertices = 'ROBUST_MESH_VERTICES',
	FeaturePoints = 'FEATURE_POINTS'
	FeaturePoints = 'FEATURE_POINTS'